Step :1 Save the below script UpgradeSite.PS1 and map the .bat file and execute run with admin
-----------------------------------------------start-----------------------------------------
---------------------------------------end script----------------------------------------------------
Step bat file : Open notepad and Save UpgradeSite.bat below line
--------------------------------------------------------------------------------
-----------------------------------------------start-----------------------------------------
if ((Get-PSSnapin
"Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)
-eq $null)
{
Add-PSSnapin
"Microsoft.SharePoint.PowerShell"
}
$webApps = Get-SPWebApplication
foreach($webApp
in $webApps)
{
$sites = $webApp.Sites
foreach($site
in $sites)
{
Upgrade-SPSite $site.RootWeb.Url -VersionUpgrade -Unthrottled
$site.Dispose()
}
}
cd /d %~dp0
powershell -noexit -file "UpgradeSite.PS1" "%CD%"
pause
No comments:
Post a Comment