2

I have a fresh installation of Windows 10 Pro 21H2 v10.0.19044.1889 on a Dell XPS laptop. If I put the machine to sleep (e.g. Win+X, U, S), when it comes out of sleep it does not ask for a password. I want the machine to ask for a password when coming out of sleep.

  • Settings > Accounts > Sign-in Options > Require sign-in is set to Every Time. However there is also a message in red that says, "Your PC's power settings are preventing some options from being shown"; I don't know what this means.
  • Under Control Panel > Hardware and Sound > Power Options > Edit Plan Settings and even under Power Options > Advanced Settings, there is nothing related to the computer asking for a password when coming out of sleep.
  • Under Screen Saver Settings, I have On resume, display login screen enabled.
  • As per How to Enable Require a Login Password on Wakeup, I've tried enabling Computer Configuration > Administrative Templates > System > Power Management > Sleep Settings > Require a Password when the computer wakes (on battery) when running on battery, but nothing changes. (Besides, the help section says, "If you enable or do not configure this policy setting, the user is prompted for a password when the system resumes from sleep." So I should be presented a password already, even without changing this setting.)

My workaround is to first lock the machine (e.g. Win+L), and then use the power button to select "Sleep", but this is inconvenient.

6
  • "Your PC's power settings are preventing some options from being shown" - It means the selected Power Plan is preventing options from being shown. The likelihood of those options being relevant to your situation is extremely low.
    – Ramhound
    Commented Aug 18, 2022 at 16:26
  • 1
    Is this machine connected to an AD domain by chance?
    – Ramhound
    Commented Aug 19, 2022 at 17:19
  • The machine is not connected to an AD domain. But when I changed the PC name, I did specify some workgroup name, e.g. WORKGROUP. Commented Aug 19, 2022 at 18:55
  • 1)Is this a vanilla install of Windows from Microsoft or one that has been modified (ex: DISM) or is an image? 2)Please provide the Dell model. Have you talked to Dell about this? 3)Can you test the sleep when connected ONLY to a power cord, then try again with absolutely nothing connected to laptop? 4)If anything is plugged into the laptop (ex: mouse, thumb drive, dock, monitor, etc.) please remove it while testing. I've seen a SMARTBoard (whiteboard that has mouse interaction) prevent numerous PC's from locking themselves
    – gregg
    Commented Aug 22, 2022 at 21:50
  • 1
    DGoiko have you ever worked in a coffee shop and then walked home and didn't want to power down the machine completely, but still you didn't want the fans running in your backpack and didn't want the battery running down for no purpose? It's that sort of idea. That example stands for a hundred. Commented Aug 26, 2022 at 18:02

5 Answers 5

2

Option 1: Disable Modern Standby

  1. Create a Restore Point

  2. Start regedit.exe

  3. Go to the following branch in the Registry Editor:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power

  4. Set CsEnabled DWORD value to 0

  5. Set PlatformAoAcOverride DWORD value to 0

    If one or both values are missing, create the DWORD value(s) manually.

  6. Exit the Registry Editor and restart Windows.

  7. Launch the "Sign-in Option" page in Settings and enable the option "When PC wakes from sleep" under "Require sign-in."

    enter image description here

Option 2

Enable the "Prompt for password on resume from hibernate/suspend" policy setting. It's located under:

User Configuration > Administrative Templates > System > Power Management

This policy setting allows you to configure client computers to lock and prompt for a password when resuming from a hibernate or suspend state. If you enable this policy setting, the client computer is locked and prompted for a password when it is resumed from a suspend or hibernate state. If you disable or do not configure this policy setting, users control if their computer is automatically locked or not after performing a resume operation.

Equivalent registry setting:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\System\Power]
"PromptPasswordOnResume"=dword:00000001

Option 3: Enable the DelayLockInterval registry value

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"DelayLockInterval"=dword:00000000

Restart Windows after applying the registry/GP.

3
  • I haven't yet tried this, but there are reports that the registry options have changed. Nevertheless what if I want to retain Modern Standby (apparently the new version of Connected Standby) but still want to require sign-in when returning from Modern Standby? My Android phone can do it when I turn off the screen. Why can't Windows 10 do it? Commented Aug 20, 2022 at 16:39
  • @GarretWilson: See my modified post. The 3rd setting corresponds to the "If you've been away..." in Settings UI. The value of data of 0 is the same as setting "Every time."
    – w32sh
    Commented Aug 20, 2022 at 17:14
  • What does the first registry setting (CsEnabled) do? Every "How to disable Modern Standby" guide I've read only mentions the second registry setting. Commented May 16 at 1:23
1

A method you haven't tried:

  • Open Settings > Accounts > Sign-in options

  • Under "Require sign-in", set "If you've been away, when should Windows require you to sign in again?" to "When PC wakes up from sleep"

  • Reboot.

If this doesn't work, then I suggest to create a new balanced power plan, since yours might have a setting that blocks this.

enter image description here

11
  • The only options under "If you've been away, when should Windows require you to sign in again?" are "Every Time", "1 minute", "3 minutes", and "5 minutes". There is nothing in this drop-down list related to waking from sleep. Commented Aug 19, 2022 at 15:22
  • Are you on Windows 10 21H2?
    – harrymc
    Commented Aug 19, 2022 at 16:05
  • Yes, I'm on Windows 10 21H2 (Version 10.0.19044.1889). Commented Aug 19, 2022 at 17:14
  • 1
    When PC wakes up from sleep most definitely should be an option; the only thing I can think of, is you are not connected to a Microsoft Account or your machine is connected to an AD domain.
    – Ramhound
    Commented Aug 19, 2022 at 17:20
  • I'm on Windows 10 Enterprise 21H2 with local account. I added an image of my options. Very very weird. What is your power plan, and have you changed any settings there?
    – harrymc
    Commented Aug 19, 2022 at 17:43
1

Group policy editor - Admin template - system - power management...

enter image description here

1
  • This was already covered in the question. It doesn't work. Besides, read that it says will happen if you do not configure this item. It says that if I don't configure the item, the computer will ask me for a password, which it isn't doing. And setting this doesn't help either. Commented Aug 21, 2022 at 15:13
0

TL;DR: Dell and Microsoft are pushing a new "modern" type of sleep that maintains network connections and continues working; and Windows 10 still hasn't got with the program and figured out how to lock the computer when entering this mode—but there is a workaround.

Modern Standby

Microsoft is pushing a new type of sleep called Modern Standby, which is not the same as the S3 level sleep Windows was built to handle with the "ask for password after sleep" functionality. Dell is promoting Modern Standby as well. Unfortunately on later machines it's basically impossible to switch to S3 sleep "without a complete OS re-install", and even then it may not work. See How to Disable Modern Standby in Windows? for a longer discussion, but no real solution.

Asking for a Password

In many ways the S0 vs S3 standby debate is missing the point. Maybe I like this "light sleep". Or maybe instead I want the network connections to be turned off (which actually may be possible in Modern Standby). Whatever the case, the real issue is that, whether it's S0 or S3 standby, I want Windows to ask for a password when "coming back to life"; that is, exiting the standby state.

Unfortunately Windows 10 hasn't figured such a simple thing out. Sure, under "Screen Saver Settings", I can tell Windows to turn on a screen saver after X minutes, and "On Resume, display logon screen". But apparently at Microsoft they can't figure out how (or haven't realized they needed) to apply the same option to S0 standby.

Workarounds

Workaround with Screen Saver

It's interesting to note that in the S0 sleep mode, the screen saver wait time apparently keeps counting, so if the screen saver "comes on" during Modern Standby, Windows will honor the "On resume, display login screen" option. So one workaround is to set the screen saver timeout to really low. This doesn't fully work around the problem, it just brings in other related functionality to compensate for the standard functionality not being offered. And it still doesn't lock the computer immediately.

Workaround with AutoHotkey

The other option is to only go into the Modern Standby mode when a hotkey is pressed, and along with the hotkey script actually lock the computer after entering "sleep" mode! Because as described above in "sleep" the computer isn't really asleep anymore with Modern Standby, the computer happily locks itself after sleep is initiated if requested.

The following script relies on AutoHotkey v2. Note that the script itself uses a workaround to even enter sleep, as the standard approaches such as DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0) don't work on Modern Standby. (You saw that coming, right?) The script is mapped to Win+z (for "zzzzz sleep"), but you can set your own hotkey combination.

#z::
{
  WinActivate "ahk_class Shell_TrayWnd"
  Send "#x"
  Sleep 100
  Send "us"
  DllCall("LockWorkStation")
}
-1

This works. I just did it on my new windows 10 installation on a new computer. It was driving me crazy too.

Go to [Control Panel],
then [Power Options],
then [Change screen saver],
then tick the box "[ ] On resume, display logon screen"

Thanks for the [Windows]-L tip.
Good luck.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 24, 2023 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .