Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'd like to query a list or library to determine how many public views it contains and what the name of those views are. Any suggestions?

share|improve this question

1 Answer 1

You can use this small powershell script for this:

[System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$site = Get-SPSite "http://yoursharepointsiteurl/"
$web = $site.rootweb
$list = $web.Lists["yourlistname"]
Write-host $list.Views

It will show the publicly available list views for a given list.

share|improve this answer
    
Thanks Arko. I called the PowerShell via C# and attached it as a WebPart to get the result on the list view I needed. I was originally hoping to find a simpler way via CAML. –  Sunny May 28 '13 at 5:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.