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/

 

推荐方法

@@@code

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

}

 

 

@@#

 

方法二:

@@@code

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

@@#

 

 

 

posted @ 2020-04-09 15:33  秦秋随  阅读(1403)  评论(0编辑  收藏  举报