How to disable Password protect the screen saver in group policy with a powershell command/script?

Dilusha Munasinghe 0 Reputation points
2023-11-22T05:20:19.6533333+00:00

i want to disable Password protect the screen saver in group policy with a powershell command/script?

i have run this command it didn't work. still shows as enabled in group policy

Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name ScreenSaveUsePassword -Value 0

i have tried below but it didn't work.

https://stackoverflow.com/questions/45578414/setting-windows-screensaver-require-password-with-powershell

when i run ,

Set-OnResumeDisplayLogon(0)

it outputs an error.

you cannot call a method on a null valued expression. 
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-11-22T08:42:54.6933333+00:00

    Hello Dilusha Munasinghe,

    You can try to run the commands in the similar thread.

    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /f /v ScreenSaverIsSecure /t REG_SZ /d 0

    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /f /v ScreenSaveActive /t REG_SZ /d 0

    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /f /v SCRNSAVE.EXE /t REG_SZ /d C:\Windows\System32\scrnsavex.scr

    Note: For the third command, setting the value of this item to a dummy "screensaver" program effectively disabled the screensaver. It might be enough to set the item to a null/empty value.
    Please run the commands in similar test lab forstly, then if it works, you can disable screen saver in production environment.

    For more information, please check the information in the similar thread.

    https://superuser.com/questions/1768893/windows-11-modify-screensaver-behavior-via-script

    If you have any question or concern, please feel free to let us know.

    Best Regards,
    Daisy Zhou

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.