Fix Access Denied When Changing OneDrive Locale via PowerShell
Question details
The user needs to resolve an Access Denied error when running a PowerShell script to change the OneDrive for Business locale for all users.

- Product
- OneDrive for Business
- Device & OS
- not provided
- Scenario
- An IT administrator is attempting to bulk update the regional settings (locale) for all employee OneDrive accounts using a PowerShell script but encounters access and execution failures.
- Observed behavior
- The PowerShell script returns an Access Denied error or halts entirely, failing to apply the locale change to the remaining users' OneDrive sites.
Ensure you have SharePoint Administrator or Global Administrator privileges in your Microsoft 365 tenant before executing tenant-wide PowerShell scripts.
Resolve Provisioning and Administrator Permissions
Ensure all users have active OneDrive sites and the executing admin has correct permissions to avoid Access Denied errors.
A loop-based PowerShell script will often halt and fail to update remaining users if it encounters a single user whose OneDrive has not been fully provisioned or where permissions are restricted.
Ensure that every targeted user has signed in and accessed their OneDrive for Business at least once. This initial access triggers the actual site provisioning process in SharePoint.
Configure your script or tenant settings to add your administrator account as a secondary site collection administrator for each user's individual OneDrive site before executing the locale update.

Configure PowerShell SharePoint Client Assemblies
Properly load the required libraries and authenticate to ensure the script can interact with SharePoint and OneDrive.
Verify Locale Settings in OneDrive
Confirm that you are checking the correct settings menu to see the successfully applied locale changes.
Simplify Your Document Workflow with WPS Office
Managing enterprise Microsoft 365 environments and running complex PowerShell scripts can be time-consuming. Equip your team with WPS Office, a highly compatible, lightweight, and cost-effective alternative for everyday document editing and collaboration.
- 1. Download WPS Office: Visit the official WPS website to download the free installer for your operating system.
- 2. Install the application: Run the lightweight installer and complete the setup process in just a few clicks.
- 3. Open your files: Instantly open your existing Microsoft Office files and start working with zero learning curve.

Frequently Asked Questions
Why does my PowerShell script stop updating users halfway through?
Loop-based PowerShell scripts will often fail and halt if they encounter a user whose OneDrive has not been provisioned yet or if the admin account executing the script lacks Site Collection Administrator permissions for that specific user's site.
Does changing the OneDrive locale change the user's Microsoft 365 account region?
No, updating the locale via this specific PowerShell script only modifies the regional settings for the user's OneDrive for Business site. The main Microsoft 365 user account's regional settings remain separate and must be modified in the Microsoft 365 admin center or Azure AD.
How can users manually check their OneDrive locale?
Users can check their locale by opening OneDrive on the web, clicking Settings (gear icon) > OneDrive settings > More settings > Return to the old site settings pages, and finally selecting Regional settings to view the Locale.




