In a SharePoint 2010 to SharePoint 2016 migration project I was recently involved in, I noticed that in the new SharePoint 2016 Portal, the logo URL in all sites was pointing to an invalid URL.

The Problem

The reason for this is that the Logo URL was pointing to a URL in the SharePoint hive (_layouts virtual directory) and the _layouts virtual directory URL has changed from SharePoint 2010 to SharePoint 2016:

  • SharePoint 2010 Layouts root virtual directory URL: /_layouts
  • SharePoint 2016 Layouts root virtual directory URL: /_layouts/15

The Solution

Since the site collection has a lot of subsites and I would like to avoid having to change the logo URL manually one by one, I built a small PowerShell script that will loop all the sub sites in the site collection and change the Logo URL for each one. Here is the script:

$sitelogo = "/_layouts/15/Images/logo.jpg"

$site = "https://intranet"

$sites = new-object Microsoft.SharePoint.SPSite($site)

foreach ($web in $sites.Allwebs) {

$webUrl = $web.Url

"Changing site logo url at $webUrl"

$web.SiteLogoUrl = $sitelogo




NOTE: This script should also be valid for SharePoint 2013 and SharePoint 2019.

Hope this helps!

Related Articles

If you are a SharePoint administrator or a SharePoint developer who wants to learn more about how to install a SharePoint 2019 farm in an automated way using PowerShell, I invite you to click here and here.

If you want to learn how to upgrade a SharePoint 2013 farm to SharePoint 2019, click here and here.

If SharePoint 2019 is still not an option, you can learn more about how to install a SharePoint 2016 farm in an automated way using PowerShell, here and here.

If you are involved in a SharePoint upgrade and want to learn more about the upgrade process, click here and here.

If you want to know all about SharePoint 2019, the new version of SharePoint Server, click here.

If you are new to SharePoint and Office 365 and want to learn all about it, take a look at these learning resources.

If you are work in a large organization who is using Office 365 or thinking to move to Office 365 and are considering between a single or multiple Office 365 tenants, I invite you to read this article.

If you want to know all about the latest SharePoint and Office 365 announcements from Ignite and some more recent announcements, including Microsoft Search, What’s New to Build a Modern Intranet with SharePoint in Office 365, Deeper Integration between Microsoft Teams and SharePoint and the latest news on SharePoint development, click here.

Happy SharePointing!


Please enter your comment!
Please enter your name here