Open mcfly1923 opened 3 weeks ago
Hi,
$username = test $password = test123
$regKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" Set-ItemProperty -Path $regKey -Name "AutoAdminLogon" -Value 1 Set-ItemProperty -Path $regKey -Name "DefaultUserName" -Value $username Set-ItemProperty -Path $regKey -Name "DefaultPassword" -Value $password
Restart-Computer -Force
Hi,
I am looking for a remediate script to check for autologon and set it if it not listed. This is the ps I have for it.
PowerShell script to enable autologon on an Intune managed devices
Define the username and password for autologon
$username = test $password = test123
Set the registry keys for autologon
$regKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" Set-ItemProperty -Path $regKey -Name "AutoAdminLogon" -Value 1 Set-ItemProperty -Path $regKey -Name "DefaultUserName" -Value $username Set-ItemProperty -Path $regKey -Name "DefaultPassword" -Value $password
Restart the computer to apply the changes
Restart-Computer -Force