Nov 02 2016 04:17 AM
Hi everybody,
most of us know the different places where time zones are to set in O365 - SharePoint Sites, ODFB, Users, etc. This is a mess...
I (Owner & Member) tried to set the time zone for a O365 Group Site via website-settings, but I got an access denied. Can anybody help me out, why I am not able to set the time zone?
Or is it possible via Powershell to set the time zone for (all) O365-Groups (or SharePoint-Sites, Users, ODFB, etc.)?
For ODFB, there is already a PS script in the OneDrive community - see https://techcommunity.microsoft.com/t5/OneDrive-for-Business/Timezone-setting-in-ODFB/m-p/7091#M153
Thanks!
Nov 21 2016 03:00 AM
Well, this morning I have been able to change interactively the time zone for some newly created groups. Hence it appears the inability was only a temporary glitch...
BTW, I found a way to interactively add an SCA to the Group site (as well as to every other site): if you add the string "/_layouts/mngsiteadmin.aspx" to the site address, you will get a page in which you can edit the SCA list.
Nov 21 2016 03:27 AM
Mar 14 2017 09:15 AM
Well done santosh, it works. Awesome 🙂
Jul 21 2017 09:38 AM
Thanks for this script - going to be very useful for my UK clients. However, am I the only one who thinks that regional settings and timezones in Office 365 are just broken? Why are their regional settings per anything at all? Sure, I can show my client how to change from USA to UK time zone and UK formats, but why is this setting there at all? Surely the entire Office 365 suite esp. SharePoint should pick up my own regional settings in my profile and use that to adjust UTC dates to my local time zone and then the locale settings to decide how to display it?
How does all of this work for a global company where they have users in different time zones? Surely those in the USA want to know what the local time was when a UK user edited a file?
This has perplexed me since I start using Office 365 and now it's a bee in my bonnet. I see the original poster acknowledges this is a mess!
Dec 19 2017 02:20 AM
The more I'm using new 365 features like Groups and Teams, the more I'm coming across this complete cluster-f*%^ that is regional settings. It has not been thought through at all by Microsoft. The world seems to start and end in the United States, completely ignoring anyone with a regional setting anywhere else that the US. The amount of different places where it is wrong is staggering, even between things that are supposed to be unified such as a O365 Group and Modern Team site.
Apr 12 2018 12:12 PM
Interesting. I get lots of access errors when I try to run this script. I'm logged in as a tenant administrator. It seems like the error is generated when the script attempts to update the settings. Is there anything special that needs to be done to set up the script to work?
Apr 16 2018 11:57 AM
@TonyRedmond I think site designs is now the better way to do this, here is how I set timezone by default on new sites
https://regarding365.com/set-the-default-region-and-timezone-for-microsoft-teams-sites-a3b4d98da8c1
You can also apply a sitedesign using powershell to an existing site using Invoke-SPOSite
Apr 16 2018 12:00 PM
Yes, I know about site designs and am using one very successfully for new sites created by Groups and Teams (and will have an article about same on Petri.com soon after I get some other stuff done). The question is how to deal with old sites that still have the Pacific time zone. I'll look at the Invoke-SpoSiteDesign cmdlet. Maybe it will be more cooperative than CSOM.
Apr 16 2018 12:28 PM
The Invoke-SPOSiteDesign method works pretty well. At least, it updated 109 of my 142 groups. I don't quite know why the other sites failed to be updated because I ran the script using the Administrator (tenant global administrator) account, but c'est la vie.
Here's what I used:
$SitesUpdated = 0 $SiteProblems = 0 $DesignID = "11c2efae-d0eb-4eb9-af71-4f4f5c5c6db8" $Groups = (Get-UnifiedGroup | ? {$_.SharePointSiteUrl -ne $Null} | Select SharePointSiteUrl, DisplayName, Alias) ForEach ($G in $Groups) { Try { Write-Host "Processing" $G.SharePointSiteUrl "for group" $G.DisplayName Invoke-SPOSiteDesign -Identity $DesignID -WebUrl $G.SharePointSiteURL -ErrorAction Stop $SitesUpdated++ Set-UnifiedGroup -Identity $G.Alias -CustomAttribute13 "Site Design Updated" } Catch { Write-Host "Problem Processing" $G.SharePointSiteURL $SiteProblems++ } }
Aug 15 2018 11:59 AM
Here is a tweak on the script that was shared to set the TimeZone on all sharepoint sites in a tenant. I think this works a bit quicker/better then just doing it for team sites, since all the communication sites need the timezone fixed as well.
(I tired to add this as a code block but the editor did not like it)
$cred = get-credential$TimezoneValue= "(UTC-06:00) Central Time (US and Canada)"$localeid = 1033Connect-SPOService -Url https://<<TenantName>>-admin.sharepoint.com -Credential $cred$Groups = Get-SPOSite | select URL#Authenticate to Site$Username =$cred.UserName.ToString()$Password = $cred.GetNetworkCredential().Password$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username,$SecurePassword)foreach($site in $Groups.URL){$Context = New-Object Microsoft.SharePoint.Client.ClientContext($Site)$Context.Credentials = $Creds$TimeZones = $Context.Web.RegionalSettings.TimeZones$Context.Load($TimeZones)$Context.ExecuteQuery()$TimeZone = $TimeZones | Where {$_.Description -eq $TimezoneValue}#Changing the timezone$RegionalSettings = $Context.Web.RegionalSettings$Context.Load($RegionalSettings)$Context.ExecuteQuery()$RegionalSettings.TimeZone = $TimeZone$RegionalSettings.Localeid = $localeid$Context.Web.Update()$Context.ExecuteQuery()Write-Host "Time Zone successfully updated for $($site) "}
Oct 10 2018 09:43 PM
Hi
All I would like to do is update the language for all Office365 groups.
when I try to use your script I get the below error.
the groups are private and I am a global admin
Any help would be great. thank you.
Exception calling "ExecuteQuery" with "0" argument(s): "Access denied. You do not have permission to perform this
action or access this resource."
At line:18 char:1
+ $Context.ExecuteQuery()
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ServerUnauthorizedAccessException
Oct 10 2018 10:06 PM
Dec 25 2019 09:31 AM - edited Dec 25 2019 09:32 AM
Only this solution WORKED for me:
https://chuvash.eu/2019/08/30/update-localeid-and-timezone-with-pnp/
I was finally to change LocaleID on my existing Sharepoint site for correct formula language in Excel Online files.
Sharepoint LocalZones ID here
https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/jj171282(v%3Doffice.15)