Skip to content

Instantly share code, notes, and snippets.

@matejskubic
Last active July 21, 2025 10:13
Show Gist options
  • Save matejskubic/8c2316a5681c76974526f9f6efde4db1 to your computer and use it in GitHub Desktop.
Save matejskubic/8c2316a5681c76974526f9f6efde4db1 to your computer and use it in GitHub Desktop.
Configure Windows security policies to hide the last signed-in username, conceal user information on the lock screen, and require manual username entry at logon.
### Configure Windows security policies to hide the last signed-in username, conceal user information on the lock screen, and require manual username entry at logon.
# logon: Don't display last signed-in Username
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DontDisplayLastUserName" -Value 1
# Do not display user information when the session is locked
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DontDisplayLockedUserID" -Value 3
# Force Manual Username Entry (required to press CTRL+ALT+DEL before logging on to Windows)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DisableCAD" -Value 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment