How to Change the SharePoint Site Logo with PowerShell?

We can change SharePoint 2013 site logo by going to: Site Settings >> “Title, Description, and Logo” from the SharePoint web user interface:

sharepoint powershell change site logo

Now, Let’s change the logo for all sites in a site collection through PowerShell to save time.

SharePoint 2013 change site logo programmatically using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

#Web URL to update Logo 
$WebURL = "https://sharepoint.crescent.com/sites/operations/us/"

#Get the Web
$Web = Get-SPWeb $WebURL

$web.SiteLogoUrl = "/_layouts/15/images/sharepoint-diary-logo.png"  #can be from any library too: "/sites/operations/images/Corp-Logo.png"
$web.Update()

Write-host "Logo updated for :"$WebURL

This script changes the logo programmatically for a single site.

You can copy the logo file to each WFE to retrieve the logo from the file system rather than from a SharePoint library. The “Images” virtual folder is mapped with “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\IMAGES” in the file system.

Make sure your logo file is accessible to everyone. Users must have read access, at least! And it should be approved (if content approvals is ON. Checked-in and published, too!). Otherwise, your users may end up with continuous authentication prompts without page loading when accessing SharePoint sites!

Update logo URL using PowerShell for a SharePoint Site collection:

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

$SiteURL = "https://Your-Site-Collection-URL"

#Get the site collection
$Site = Get-SPSite $SiteURL

#Iterate through each site in the site collection 
foreach($web in $Site.AllWebs)
{   
    #sharepoint change logo programmatically 
    $web.SiteLogoUrl = "/relative-path-logo-file" 
    $web.Update()
} 

This script changes the logo for all sites in SharePoint 2010 (or SharePoint 2013).

sharepoint powershell change site logo

SharePoint PowerShell Change Site logo for All sites in a Web Application:

Let’s change the logo for the entire web application in a one-liner:

#sharepoint 2016/2013 change logo for all sites 

Get-SPWebApplication "https://sharepoint.crescent.com" | Get-SPSite -Limit "All" | Get-SPWeb -Limit "All" |  foreach { $_.SiteLogoUrl=""; $_.update(); Write-host "Changing Logo for:"$_.Url;  }

All of these scripts are valid for SharePoint 2010 also!

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

3 thoughts on “How to Change the SharePoint Site Logo with PowerShell?

  • This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.

    Reply
  • I have seen a hundred posts on how to change the logo and I can certainly do that without issue. But how do you change the ALT text? I cannot find anything! I have changed all the logos on our sites, but when you hover, it shows the text for the old logo. Company name has changed, so I need it changed there too. HELP

    Reply
    • By default the site title is used as Alt text for Logos. It appears that, whatever we enter in the “Description Text” field for the Logo is ignored!

      Reply

Leave a Reply