PowerShell List all Lists and their GUIDs

This PowerShell will list all of the lists in a subsite and their GUIDS. 

UPDATE: including all view guids.

cls
$snapIn = Get-PSSnapin | where-object {$_.Name -eq "Microsoft.SharePoint.PowerShell"} 
if($snapIn -eq $null) {   
Add-PsSnapin Microsoft.SharePoint.PowerShell 
} 
$website = Get-SPWeb -identity https://WEBAPP/sites/SITE/WEB 
$website | ForEach-Object { 
write-host "Checking site:"$_.Title 
#Go through each List in the site   
$_.Lists | ForEach-Object { 
write-host "List:"$_.Title " - List Id:"$_.Id   
$_.Views | ForEach-Object {
write-host "View:"$_.Title " - View Id:"$_.Id
} 
#Dispose of the site object   
$website.Dispose()   
}   
}
Advertisements

4 Responses to PowerShell List all Lists and their GUIDs

  1. Ryan Dunn says:

    Wow… extremely helpful. Thanks for the post! I’m working on list management from the power shell and this is a great place to start.

  2. Anonymous says:

    Very helpful. I’m working on cleaning my web site before migration. Thanks !

  3. Anonymous says:

    Very helpful. We had a Problem with the view of a Library. A User delete all views. 😦

  4. Mahesh says:

    Thanks for such a great script. made my life easy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: