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

@@#

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM