Category filter
Script to enable Windows automatic logon for screenless kiosk
Automatic logon in Windows is a feature that makes a specific user account accessible on the device without entering the username and password. This feature enables quick access to the device and in screenless kiosks, which don’t rely on display screens for user interaction. Instead, they utilize other input/output mechanisms like voice commands, RFID scanners, or physical buttons.
For screenless kiosks, administrators can set up auto logon with the help of a custom script. When setting up automatic logon for Windows screenless kiosk, it’s important to note that only the specific user account designated for the kiosk mode is accessible, with other user accounts remaining inaccessible. This script also ensures that devices never enter sleep mode.
Screenless kiosk mode with automatic logon can be integrated into both the single app kiosk and multi app kiosk features provided by Hexnode UEM. To enable screenless kiosk mode for a specific user account, IT administrators can deploy the necessary kiosk policy to the target device using Hexnode UEM. Once the policy is in place, they can execute the script to automate the user account login via the Execute Custom Script remote action.
Scripting language – PowerShell
File extension – .ps1
Turn on automatic logon in Windows
Here, the PowerShell script is designed to simplify the specific user account login and power settings on a Windows system. Replace Username and Password with the actual username and password of the kiosk user account whose login needs to be automated.
1 2 3 4 5 6 7 8 9 10 11 12 |
$Username = "Username" $Password = "Password" $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" Set-ItemProperty -Path $RegPath -Name "AutoAdminLogon" -Value 1 Set-ItemProperty -Path $RegPath -Name "DefaultUsername" -Value $Username Set-ItemProperty -Path $RegPath -Name "DefaultPassword" -Value $Password New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" -Name "LogonUserSwitch" -Value 0 -Force powercfg -change -monitor-timeout-ac 0 powercfg -change -monitor-timeout-dc 0 powercfg -change -standby-timeout-ac 0 powercfg -change -standby-timeout-dc 0 Restart-Computer -Force |
The script uses the Windows Registry, specifically targeting the path HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon to automate the user login by setting AutoAdminLogon to 1 and specifying the user account’s credentials with DefaultUsername and DefaultPassword.
Additionally, it creates a registry key under HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI to disable user account switching during login. The script further customizes power settings using powercfg commands, setting timeout to 0 to prevent the device from entering standby due to inactivity. Finally, the script forcefully restarts the computer with the help of Restart-Computer –Force command to apply the configured changes.
What happens at the device end?
Upon successful execution of the script, the device will restart, and automatically log into the specified kiosk user account without requiring the username and password, thus activating kiosk mode.