SharePoint Set Locale Region on All Web Applications and Site Collections
A quick script works on both SharePoint 2010 and 2013. Make sure to update en-AU to the target locale you are after =).
Enjoy!
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | ? -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs)
{
$NewLocale = "en-AU"
foreach ($webApp in $websvc.WebApplications)
{
foreach ($site in $webApp.Sites)
{
Write-Host "Updating Site -" $site -ForegroundColor "Green"
$Webs = $site.AllWebs
ForEach ($Web In $Webs)
{
If ($Web.locale -ne $NewLocale)
{
Write-Host $Web.title "- " -NoNewLine; Write-Host "changing from" $Web.locale "to" $NewLocale -ForegroundColor "Green"
$Web.Locale = $NewLocale
$Web.Update()
$Web.Dispose()
}
Else { Write-Host $Web.title "- " -NoNewLine; Write-Host "already set to" $NewLocale -ForegroundColor "Blue"
}
}
}
}
}
Enjoy!
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | ? -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs)
{
$NewLocale = "en-AU"
foreach ($webApp in $websvc.WebApplications)
{
foreach ($site in $webApp.Sites)
{
Write-Host "Updating Site -" $site -ForegroundColor "Green"
$Webs = $site.AllWebs
ForEach ($Web In $Webs)
{
If ($Web.locale -ne $NewLocale)
{
Write-Host $Web.title "- " -NoNewLine; Write-Host "changing from" $Web.locale "to" $NewLocale -ForegroundColor "Green"
$Web.Locale = $NewLocale
$Web.Update()
$Web.Dispose()
}
Else { Write-Host $Web.title "- " -NoNewLine; Write-Host "already set to" $NewLocale -ForegroundColor "Blue"
}
}
}
}
}
Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions.
ReplyDeleteweb hosting in Nigeria
This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
ReplyDeleteinternet marketing services pricing
The report is assembled with the determination of providing necessary market information to retailers operating in the global market.siteground vs bluehost
ReplyDelete