Sunday, 3 November 2013

PowerShell: Loop through all the sites in a site collection (not recursive)

$site = Get-SPSite "http://mysitetosearch.com"
$topWeb = Get-SPWeb $site.Url
$site | Get-SPWeb -limit all | ForEach-Object { Write-Host "Found $_.Name"; }

No comments:

Post a comment