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.
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