Home » SharePoint 2010 » PowerShell Script to enable Visual Upgrade for all webs under a site collection

PowerShell Script to enable Visual Upgrade for all webs under a site collection


When you upgrade from Microsoft Office SharePoint Server 2007 to Microsoft SharePoint Server 2010, you can choose to use the Visual Upgrade feature to give site collection owners and site owners the opportunity to preserve the previous user interface temporarily

When you upgrade, either by using in-place upgrade or by using the database attach upgrade method, you can choose to use Visual Upgrade.

How to use this script

1) Copy below code to .PS1 file

2) Run the .PS1 using SharePoint 2010 Management Shell

3) Parameters to .PS1

ex: visualupgrade.ps1 1 “http://w7-pathikhr”

Param 1: 0 or 1

Param 2: URL of the Site Collection

param([int] $RestrictVisualUpgrade = 0,$siteurl)
[System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”) | out-null
 
$oContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService;
 
[Microsoft.SharePoint.Administration.SPWebApplicationCollection]$waColl = $oContentService.WebApplications;
 
$waCollNonAdmin = $waColl | where-object {$_.IsAdministrationWebApplication -eq $FALSE}
 
 
write-host $siteurl
 
$siteColl = Get-SPSite $siteurl
 
        $siteColl.UIVersionConfigurationEnabled = $RestrictVisualUpgrade
        foreach($web in $siteColl.AllWebs)
        {
$web.UIVersionConfigurationEnabled = $RestrictVisualUpgrade
            $web.Update()
        }
   
   
 
 
 

 

To learn more about Visual upgrade visit http://technet.microsoft.com/en-us/library/ff607998.aspx

Thanks

About these ads

2 Comments

  1. Thanks a bunch! That was incredible :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 81 other followers

%d bloggers like this: