Visual Upgrade All SharePoint Sites in a web application using PowerShell

After the Migration using database attachment method, Had to upgrade all sites to New SharePoint 2010 User Interface. Used this PowerShell code to accomplish.

SharePoint 2010 visual upgrade using PowerShell script

##### Visual Upgrade All SharePoint Sites to 2010 version in a Web Application #####
 
$SPwebApp = Get-SPWebApplication "https://migration.company.com"
 
    foreach ($SPsite in $SPwebApp.Sites)
    {
       foreach($SPweb in $SPsite.AllWebs)
        {
         
           $SPweb.UIVersion = 4  #set it to 3 if you want SharePoint 2007 look and feel
       $SPweb.Update()
    write-host $spweb.url
        }
    }
read-host  #just to pause

Or you can use the SPSite’s VisualUpgradeWebs() method:

$webapp = Get-SPWebApplication <web-app-URL>
foreach ($site in $webapp.sites)
{
   $site.VisualUpgradeWebs() 
}

Here is the Before/After images:

visual upgrade sharepoint powershell

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *