Powershell 修改组策略
参考:https://blog.51cto.com/infosec/788731
参考:http://intsir.com/index.php/archives/351/
参考:https://www.windowspasswordsrecovery.com/articles/password-policy/set-the-reset-account-lockout-counter-after-setting-in-windows-8-1-8-7.html
参考:http://intsir.com/index.php/archives/351/
推荐方法
Function SetPolice() {
$gpstr = @"
[version]
signature=""`$CHICAGO`$""
[Privilege Rights]
SeDenyRemoteInteractiveLogonRight = Administrator,Guest
[System Access]
LockoutBadCount = 4
ResetLockoutCount = 60
LockoutDuration = 60
"@
[System.IO.File]::WriteAllText("./gp.inf",$gpstr,[System.Text.Encoding]::Default)
secedit /configure /db gp.sdb /cfg gp.inf #/quiet
del gp.inf
del gp.sdb
}
@@#
方法二:
net accounts /lockoutthreshold:5
net accounts /lockoutduration:60
net accounts /lockoutwindow:60
ntrights -r SeDenyRemoteInteractiveLogonRight -u "administrator"
# https://www.tenforums.com/attachments/tutorials/228748d1553724608-allow-prevent-users-groups-shut-down-system-windows-10-a-ntrights.zip
@@#