In this tutorial we will see how we can list out all the Lists in a SharePoint site using Windows PowerShell.
Open Powershell and Enter the following cmdlets one by one.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$spsite = New-Object Microsoft.SharePoint.SPSite("http://shoban")
$spsite.AllWebs | foreach { $_.Lists | ft $_.URL, Title }
1.
2.
3.
In the first line we load the Microsoft.SharePoint assembly. In the second line we create a new SPSite object for our SharePoint site. In this case the url of the site is http://shoban
In the last line we List out all the Lists in the site. We also use the ft cmdlet to Format the Output.
If you want to write the output to a text file simply replace the last line with the following
1.
$spsite.AllWebs | foreach { $_.Lists | ft $_.URL, Title } > Lists.txt
To open the new Text file created use the Invoke-Item cmdlet.