How To Auto Lock Windows 11 |work| -

Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::Idle += if ([System.Windows.Forms.Application]::IdleTime.TotalMinutes -ge 5) rundll32.exe user32.dll,LockWorkStation

For most home users, (if you carry a phone) + Win + L habit is the easiest. If you want a pure idle timer, use Method 2 (screen saver) or Method 4 (script) . how to auto lock windows 11