我想使用 PowerShell 命令/脚本禁用组策略中屏幕保护程序的密码保护。
我已经运行了这个命令,但它不起作用。在组策略中仍然显示为已启用
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name ScreenSaveUsePassword -Value 0
我已经尝试过以下但没有成功。
使用 powershell 设置 Windows 屏幕保护程序需要密码
当我运行时,遵循上面 StackOverflow 链接上的功能,
Set-OnResumeDisplayLogon(0)
它输出一个错误。
you cannot call a method on a null-valued expression.
尝试使用此 PowerShell 命令/脚本,您可以使用它在组策略中禁用屏幕保护程序的密码保护
新项目-路径 HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Control Panel\Display -名称 ScreenSaverIsSecure -值 0 -Force
此命令将在 HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Control Panel\Display 项下创建一个名为 ScreenSaverIsSecure 的新注册表项。注册表项的值将设置为 0,这将禁用屏幕保护程序的密码保护。
要将此更改应用于所有用户,您可以使用以下命令:
新项目-路径 HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\User -名称 ScreenSaverIsSecure -值 0 -Force
这将在 HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\User 项下创建相同的注册表项,这会将更改应用于所有用户。
您还可以使用以下命令将更改应用到特定 OU:
$ou = Get-ADOrganizationalUnit -Identity "OU=YourOU,DC=YourDomain,DC=com" 新项目 -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies$ou -Name ScreenSaverIsSecure -Value 0 -Force
这将在 HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies