enumerate all sites and subsites in a web application with PowerShell

I have been struggling to make a change to each site in my SharePoint 2010 farm.  The first step was to list all sites and subsites.

get-spsite | get-spweb -Limit ALL

I can get that into an array thusly:  $allsites= (get-spsite|get-spweb -Limit ALL)

Once I have the site list "in memory" as the $allsites variable, I can then run a command on each subsite using a foreach loop.

Comments

Popular posts from this blog

ADMT fails to migrate SID History

Exchange 2010 event errors 2601, 2604, 2501

Robocopy Error 31 A device attached to the system is not functioning