Changing Azure VM’s Default Locale
I had a task at work where I was asked if I could ensure that all new Azure Virtual Machines created had the default of being set up for English (United Kingdom) rather than English (United States), not an unreasonable request by any stretch, so last week I had a look into doing just that.

The customer project I am working on uses Virtual Machines for people to do their work and the new Virtual Machines are deployed using Octopus Deploy with some ARM templates and PowerShell – all good so far.
My initial thought was I wonder why you can’t have this as an option to choose when installing a new Virtual Machine from the portal, turns out its unlikely because in fact there are a number of settings you need to change in order for the new Virtual Machine to truly be set up for English (United Kingdom) rather than English (United States).
I started off by looking at running some PowerShell into a custom extension and running that when the Virtual Machine starts, after a lot of fiddling around and trying things it does work.
The PowerShell I was using looked something like this:-
Set-WinSystemLocale en-GB
Set-WinUserLanguageList -LanguageList en-GB -Force
Set-Culture -CultureInfo en-GB
Set-WinHomeLocation -GeoId 242
Set-TimeZone "GMT Standard Time"
# restart virtual machine to apply regional settings to current user. You could also do a logoff and login.
Start-sleep -Seconds 40
Restart-Computer
Note that the above PowerShell works, the only caveat to this is that once the Virtual Machine is available to connect to you can check the system local from
Control Panel > Clock and Region > Region > Administrative Tab >

Above, we can see that the Virtual Machine still defaults to English (United States) but with a reboot that will change to English (United Kingdom).
We want this to be the case for all users who might log onto the Virtual Machine, we could use PowerShell DSC (desired state config) to do this or a number of other ways.
When I reached out to twitter for some help and guidance on this I had a number of replies but this one was the solution I went for https://twitter.com/stuartpreston/status/1284096930981847045
Stuart was very kind to even create a GitHub repo to tackle this issue and you can find his solution to the problem there, he adds a custom script variable, passes in the commands to run and a timezone variable and “it’s basically using a combination of stuffing your script into customdata and having additionalUnattendContent run that script in a first logon.“
To wrap this up it works: –
- using PowerShell
- using a custom extension with a PowerShell script
- or by adding content to an Arm Template that runs a script upon user logon
- Don’t forget to checkout my YouTube Channel.
Greg
Interested by your article and experience here. Are your VMs used by both US and UK users so you need to set the locale at runtime accordingly? We are just trying to force VMs to UK and getting them to stay there. We have service accounts for IIS and also SQL logins both of which seem to lose there UK locale after some Azure event and our app then goes back to showing US dates
We are using
Set-Culture en-GB
Set-WinSystemLocale en-GB
Set-WinHomeLocation -GeoId 242
Set-WinUserLanguageList en-GB -force
for the service accounts and
SET LANGUAGE BRITISH
dbcc useroptions
For SQL Server but as I say it works for a while and then just seems to reset itself. have you had similar experiences?
Regards
Trevor
Hi Greg,
Interestingly even running the script manually that is created by the JSON doesn’t set the langauge/location completely. My current user ends up being configured ok English UK settings but the display settings, and more importantly the new user account settings are unaffected and still point to English US.
Any thoughts?
Hi
As per the post by Jamie, it only works for the current user. For example, Administrator.
If you create another user, the settings remain as English US when they log on.
Would be very interested to know if anyone has solved this issue.
Hi.
Same as Jamie. I’ve never been able to find a solution to this.
If another user logs on they get English US and not English UK.
You can do it from the GUI on the operating system but never been able to find a way to set it automatically for all users.
Steve
Steve
For us this came down to not the user credentials on the surface but a combination of IIS and COM components meant that when impersonation came into play, issues with Delphi and where it looked in the registry for locale settings meant it looked up to the default user not the service account running the application. Our solution was to script changes to the default user which fixed this and were permanent changes
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).Locale
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).LocaleName
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sCountry
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sCurrency
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sShortDate
Set-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’ -Name ‘Locale’ -Value ‘00000809’
Set-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’ -Name ‘LocaleName’ -Value ‘en-GB’
Set-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’ -Name ‘sCountry’ -Value ‘United Kingdom’
Set-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’ -Name ‘sCurrency’ -Value ‘£’
Set-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’ -Name ‘sShortDate’ -Value ‘dd/MM/yyyy’
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).Locale
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).LocaleName
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sCountry
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sCurrency
(Get-ItemProperty -Path Registry::’HKEY_USERS\.DEFAULT\Control Panel\International’).sShortDate
Not sure if that helps your situation but I would think new accounts should pick up the default user and hence should get the overridden settings
Trev
Trev, great work works like a charm.