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

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

"The following factors also affect the level of access for" user with excess permissions

Unknown server tag 'AdminControls:MigrationToolPromotionTip'. in Central Admin after installing SharePoint 2013 security update KB4482464