Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there to loop through all site collections and change the locale settings (from US to UK), without having to visit each one in turn and change it manually? i.e. using PowerShell. I would also like to include my sites in this process and any new 'my site' created to use the correct regional settings?

share|improve this question
add comment

1 Answer 1

Locale is a property of the SPWeb so you have to do something like this

[Reflection.Assembly]::LoadWithPartialName("System.Globalization") | out-null
get-spweb -site http://yoururl -limit all |% {
    $_.Locale = [System.Globalization.CultureInfo]::GetCultureInfo(2057);
    $_.Update()
}
#see if things applied
get-spweb -site http://yoururl -limit all |% {
    $_.Locale
}

Care should be taken with the -limit argument, it could take a long time

To get site collections created with the right timezone, update the web application that they are in with the right timezone, this can be done in central admin.

To get mysites created with the right Locale, go to the mysite host's regional settings page (http://url/my/_layouts/settings.aspx) and change it there (or use powershell). New sites will get the new settings, existing sites wont.

http://lumbgaps.blogspot.com/2007/08/sharepoint-2007-set-mysite-locale.html

share|improve this answer
    
Access denied when I use get-spweb (even as a farm administrator, and running the shell with admin rights). Will it work with Get-SPSite? e.g. Get-SPSite -Identity http://my.domain.com* -Limit ALL? –  Sam Jan 6 '11 at 13:13
1  
Farm administrators do not automatically get permissions to all site collections, they have to be added to the site collection administrators group. You can use the command Get-SPSiteAdministration to get access to some properties if you are the farm administrator, but Locale is not one of them. If you want a powershell script to add a farm administrator to all site collections, create another question of me. Ta. –  djeeg Jan 6 '11 at 13:58
    
Or add a Web Application User Policy in Central Admin to grant the farm admin extra rights on the content. –  Andy Burns Jan 6 '11 at 14:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.