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"; }
$topWeb = Get-SPWeb $site.Url
$site | Get-SPWeb -limit all | ForEach-Object { Write-Host "Found $_.Name"; }
Comments
Post a Comment