Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


PowerShell Script To Traverse All Sites In SharePoint 2010 (or 2007) Farm

AddThis Social Bookmark Button
    Over the past few years I’ve written a number of blog posts on performing various actions against a site collection or web application (display site collection admins, find all SPShell admins with database, find closed web parts).  Invariably with every post I get some comments along the lines of “this is great, how can I run this against every site in the farm”.  Well today you get your wish (sort of).  Below you will find a template script that traverses all sites within your local farm.  Isn’t that great!?!     In it’s current state this
script will simply output the title and URL of every site within the farm.  You may modify the function to perform your desired actions.  One stipulation is that you must have proper access to each of the web applications / site collections in order to actually traverse them.  Please leave any feedback that you have on this template in the comments.   Scripts SharePoint 2010 Download the SharePoint 2010 template here.   Here is the source as well function RecurseSiteAndDoSomething() { param([Microsoft.SharePoint.SPWeb]$SiteIdentity) Write-Output "Site: $($SiteIdentity.Url)" ...(Read whole news on source site)

Home : Blog List : The Frog Pond of Technology : PowerShell Script To Traverse All Sites In SharePoint 2010 (or 2007) Farm