Tuesday, November 19, 2013

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"
   }
}
}
}
}

5 comments:

  1. Looking at the feedback I've got from my previous article about building a self-hosted Wordpress blog for free, and from personal experience. Web hosting reviews for small business

    ReplyDelete
  2. its really fantastic blog . its realy informational and a such a good job. i love this
    web hosting reviews

    ReplyDelete
  3. Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions.
    web hosting in Nigeria

    ReplyDelete
  4. 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.
    internet marketing services pricing

    ReplyDelete
  5. The report is assembled with the determination of providing necessary market information to retailers operating in the global market.siteground vs bluehost

    ReplyDelete