We have a bunch of laptops we normally set the registries entries in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\Winlogon (DefaultUserName, DefaultPassword), I've tried using PowerShell and running a command in a TS in MDT. So far it only adds the Name, but it leaves the data blank. If I delete the entries, it adds everything back but the data, if I try and add some fake key and data it works fine. If I run the PS or VBS manually from the admin terminal prmpt it works fine. Any suggestions?
$username = "laptop"
$password = "test"
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1 -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value $username -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $password -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 9999 -Force