magritton
8/25/2014 - 3:00 PM

This iterates through all of the web applications in SharePoint, then iterates through all of the websites in each application, and the iter

This iterates through all of the web applications in SharePoint, then iterates through all of the websites in each application, and the iterates through all of the lists with SharePoint and powershell.

$ver = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell
Set-location $home

$WebApps=Get-SPWebApplication
"WebURL|WebTitle|ListTitle|ListURL|ListID|WebID|ParentWebID"
foreach($webApp in $WebApps)
{
$wa = Get-SPWebApplication $webApp.URL
        $allSites = $wa | Get-SPSite -Limit all
        foreach ($spsite in $allSites) {
            $allWebs = $spsite.allwebs
            foreach ($spweb in $allWebs) {
            #$spweb.Url 
            foreach($list in $spweb.lists)
               {
                $spweb.Url + "|" + $spweb.Title + "|" + $list.Title + "|" + $list.RootFolder.Url + "|" + $list.ID + "|" + $spweb.ID + "|" + $spweb.ParentWebID
               }
            #$spweb.Lists | select Title,BaseType

            $spweb.dispose()
            }
        }
 
}