Skip to content

Instantly share code, notes, and snippets.

@lhns
Last active June 14, 2019 15:16
Show Gist options
  • Select an option

  • Save lhns/653a44c68c9835855d2d2b8ecfc2ba0c to your computer and use it in GitHub Desktop.

Select an option

Save lhns/653a44c68c9835855d2d2b8ecfc2ba0c to your computer and use it in GitHub Desktop.
Disable Windows 10 lock screen
#Requires -RunAsAdministrator
param ([bool]$value = $true)
New-Item -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "Personalization"
New-ItemProperty -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -PropertyType DWord -Value (&{If ($value) {1} Else {0}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment