I recently worked with a client who changed from using SharePoint Foundation to SharePoint Enterprise. One of the changes was to use an actual URL versus the server name. Obviously, there were a lot of changes that had to be made including changing the URL for the site logo on all of the site collections and Subsites. Doing this manually is not only time-consuming, but you can never be sure that you got each one. So, lets take a look at how else we can do this.
Below is some code that should help you with this task. It is not too pretty, but it will do the job. The first part is going to display the Site Logo for the site collection in question which is identified by the first $sitename.
$webapp = Get-SPWebApplication http://intranet foreach ($SPSite in $webapp.sites) $sitename= "http://bentest" $site=new-object Microsoft.SharePoint.SPSite($sitename) foreach($web in $site.Allwebs) { write-host $web.SiteLogoUrl } $site.Dispose() Change the site image for all sites in a given Site Collection $sitename= "http://bentest" $sitelogo= "http://bentest/site_documents/sitelogo.jpg" $site=new-object Microsoft.SharePoint.SPSite($sitename) foreach($web in $site.Allwebs) { $web.SiteLogoUrl=$sitelogo $web.Update() } $site.Dispose()
How did I come up with this? Well, here are some references: