K
KemperJ
Guest
I'm using LANDesk te deploy systems and remotely manage them. We have users with different kind of language settings and different keyboard layouts. The problem is that some people might want to change them. I want to do this remotely, so I want to create a script that users can activate in the LANDesk workspace (so the script can be run as local system account).
So far I am able to change the user language, system language and user keyboard. However, I can not get the keyboard layout to be set in the welcome screen.
Now I know of the GUI methods to get this working, but I need everything working through scripts (preferably Powershell, since I'm slightly familiar with it).
I see most people reference to "HKEY_USERS\.Default\Keyboard Layout\preload" when mentioning Welcome Screen keyboard layout. However, everytime I change this, it changes in the registry correctly. But after a reboot everything is set back to the previous value.
I just can not find what I have to do to permanently edit HKEY_USERS\.Default\
Code I run as user:
#Execute as user
$Taalcode = "0413"
$Taalnaam = "nl-NL"
$Taalcont = "00020409"
$TaalGeoD = "0xB0"
Set-WinUserLanguageList $Taalnaam -force
Set-WinSystemLocale $Taalnaam
Set-WinUILanguageOverride $Taalnaam
Set-Culture -CultureInfo $Taalnaam
Set-WinHomeLocation -GeoId $TaalGeoD
Code I run as local system account:
#Execute as admin
$Taalcode = "0413"
$Taalnaam = "nl-NL"
$Taalcont = "00020409"
$TaalGeoD = "0xB0"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name InstallLanguage -Value $Taalcode
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name Default -Value $Taalcode
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name InstallLanguageFallback -Value $Taalnaam
New-PSDrive -Name HKU -PSProvider Registry -Scope Global -Root HKEY_USERS
reg load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
Set-ItemProperty -Path "HKU:\DefaultUser\Keyboard Layout\preload" -Name 1 -Value "0000${Taalcode}"
Set-ItemProperty -Path "HKU:\DefaultUser\Keyboard Layout\Substitutes" -Name "0000${Taalcode}" -Value $Taalcont
reg unload HKU\DefaultUser
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.Default\Keyboard Layout\preload" -Name 1 -Value "0000${Taalcode}"
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.Default\Keyboard Layout\Substitutes" -Name "0000${Taalcode}" -Value $Taalcont
More...
So far I am able to change the user language, system language and user keyboard. However, I can not get the keyboard layout to be set in the welcome screen.
Now I know of the GUI methods to get this working, but I need everything working through scripts (preferably Powershell, since I'm slightly familiar with it).
I see most people reference to "HKEY_USERS\.Default\Keyboard Layout\preload" when mentioning Welcome Screen keyboard layout. However, everytime I change this, it changes in the registry correctly. But after a reboot everything is set back to the previous value.
I just can not find what I have to do to permanently edit HKEY_USERS\.Default\
Code I run as user:
#Execute as user
$Taalcode = "0413"
$Taalnaam = "nl-NL"
$Taalcont = "00020409"
$TaalGeoD = "0xB0"
Set-WinUserLanguageList $Taalnaam -force
Set-WinSystemLocale $Taalnaam
Set-WinUILanguageOverride $Taalnaam
Set-Culture -CultureInfo $Taalnaam
Set-WinHomeLocation -GeoId $TaalGeoD
Code I run as local system account:
#Execute as admin
$Taalcode = "0413"
$Taalnaam = "nl-NL"
$Taalcont = "00020409"
$TaalGeoD = "0xB0"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name InstallLanguage -Value $Taalcode
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name Default -Value $Taalcode
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name InstallLanguageFallback -Value $Taalnaam
New-PSDrive -Name HKU -PSProvider Registry -Scope Global -Root HKEY_USERS
reg load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
Set-ItemProperty -Path "HKU:\DefaultUser\Keyboard Layout\preload" -Name 1 -Value "0000${Taalcode}"
Set-ItemProperty -Path "HKU:\DefaultUser\Keyboard Layout\Substitutes" -Name "0000${Taalcode}" -Value $Taalcont
reg unload HKU\DefaultUser
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.Default\Keyboard Layout\preload" -Name 1 -Value "0000${Taalcode}"
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.Default\Keyboard Layout\Substitutes" -Name "0000${Taalcode}" -Value $Taalcont
More...