I have a Domain Controller that needs to be able to autologon as Administrator. I tried all the online solutions, but after every reboot I get Username or Password incorrect, while I know it is correct.
I made the autologon part into a function. (It's part of a schoolproject).
I tried to store the password as just plain text, that didn't change anything.
I don't know if this info is useful, but I use an AZERTY keyboard (Belgian Point). But the password I use is from the letters that are not affected by QWERTY or AZERTY. The password has a number, but Numlock is off at every reboot. Could that be the problem? (Would seem weird though).
Does anyone know what it is I am doing wrong?
Function Logon-Password
{
$Global:RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
$Global:domain = $env:USERDOMAIN
$Global:username = "$domain\$env:USERNAME"
$Global:password = Read-Host -AsSecureString "Type password"
Set-ItemProperty $RegPath "DefaultUserName" -Value "$username" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "$password" -type String
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String
Set-ItemProperty $RegPath "AutoLogonCount" -Value "1" -type DWord
Set-ItemProperty $RegPath "ForceAutoLogon" -Value "1" -type DWord
}