# The following function will allow the RDP session to store the user keyboard language preference as stored in the session profile.
# This bypasses the default layout provided by the Terminal Server client.
# In other words, the default keyboard layout and input language can be set by the user and saved in that profile - a log-off is required after changing this setting. All later user logons will use the default keyboard layout and input language from this profile.
# This saves users the efforts of having to manually (shitft-alt) switch the layout after each login.

function setRdpKeyboardPerProfile{
	$keyboardRegKey='REGISTRY::HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout'
	$keyName='IgnoreRemoteKeyboardLayout'
	$keyValue=1
	Set-ItemProperty -Path $keyboardRegKey -Name $keyName -Value $keyValue -Type DWORD -Force
}
setRdpKeyboardPerProfile