1

I have created over 100 users using the wrong regional settings, therefore wrong date format. I wish to correct this without logging in as every user and going through the necessary steps.

I am looking for a way to do this in one go either via UI or via Powershell script.

Ideally I want a script that will ForEach the local users and run a command to change their language/regional settings.

NOTE: I am not using Active Directory therefore cannot use group policies.

Shumii
  • 4,529
  • 5
  • 32
  • 41

1 Answers1

1

Set your desired settings in one of the users, then Get those settings from

"HKEY_CURRENT_USER\Control Panel\International"

find the SID of each user then

Apply it to each user on:

"HKEY_USERS\[UserSID]\Control Panel\International"

To get The SID of the user you can use this Function:

Function GetSIDfromSAM()
{
    Param(
        [Parameter(mandatory=$true)]$userName
    )
    $myacct = Get-WmiObject Win32_UserAccount -filter "Name='$userName'" 
    return $myacct.sid
}

GetSIDfromSAM localuser
S-1-5-21-1837353773-20556466214-3321741005-1005

Then use the Foreach section (just for example)

New-PSDrive HKU Registry HKEY_USERS

Foreach ($SID in $SIDs)
{
Set-ItemProperty -Path "HKU:\$SID\Control Panel\International" -Name "LocaleName" -Value "en-us"
}

Of course you should update all the properties, you can use a switch section with all properties and values, or other methods, let me know if you need more help on this

Avshalom
  • 8,657
  • 1
  • 25
  • 43
  • Hi thanks for your answer. Haven't tried yet but looks like a decent solution. Any chance you would like to write the whole script for me? I am a powershell noob and although I understand all the concepts I never can find the right command. For example how to specify all the regional properties is not something I find straightforward. I think the script would just need one change for it to work on my computer (the name of the account to copy from). No worries if you can't bit cheeky of me anyway. – Shumii Oct 29 '15 at 11:43
  • you should know already that SO is not a code writing etc... you should show some effort, try to use what i sugessted, i will help you to make it work, and add a text with your desired setting of the registry International key - Get-ItemProperty 'HKCU:\Control Panel\International' – Avshalom Oct 29 '15 at 12:15