For every web application having list of site collection’s and its sub sites having a site logo, some
cases we need to change site logo only for a particular site collection and its
sub sites only.
Doing it manually it will take time and effort, using the
Power Shell we can change the site logo easily.
First I am uploading the site logo in a particular site
collection library, my case I am uploading a logo in publishing images library
(http://dotnetsharepoint.com/sites/changesitelogo/publishingimages)
Using this script we can change the logo in a site
collection and its sub sites.
Run the below Power Shell script.
Add-PSSnapin Microsoft.sharepoint.powershell
#to get the site collection url
$sitecollname="http://dotnetsharepoint.com/sites/changesitelogo"
#to get the site logo
$sitecolllogo= " http://dotnetsharepoint.com/sites/changesitelogo/publishingimages/dotnetsharepointlogo.png"
$getsitecoll=new-object
Microsoft.SharePoint.SPSite($sitecollname)
foreach($webs in $getsitecoll.Allwebs)
{
$webs.SiteLogoUrl=$sitecolllogo
$webs.Update()
}
$getsitecoll.Dispose()
Once the script completed successfully, go and verify the
logo has been changed.