⚡ PowerShell 5.1+

Check "Disable Lock Screen" Status

Reads the current registry value behind the "Disable Lock Screen" tweak so you can confirm whether it's applied.

By WindowsScripting.com · 761 B
Test-DisableLockScreenStatus.ps1
<#
.SYNOPSIS
    Checks whether "Disable Lock Screen" is currently applied.

.DESCRIPTION
    Reads HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization \ NoLockScreen and reports its current value,
    or reports that it isn't set (falling back to the Windows default).

.EXAMPLE
    .\Test-DisableLockScreenStatus.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization'

$value = Get-ItemProperty -Path $regPath -Name 'NoLockScreen' -ErrorAction SilentlyContinue

if ($null -eq $value) {
    Write-Host "'NoLockScreen' is not set at $regPath (using the Windows default)." -ForegroundColor Yellow
} else {
    Write-Host "Current value of 'NoLockScreen': $($value.'NoLockScreen')" -ForegroundColor Green
}