SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You can use this small powershell script for this:


$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


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.