组策略设置如何获取?
各位高手:请教如何通过wmi或者其他方式获取组策略设置(密码策略、用户账户锁定策略、审核策略)
网上搜了下没找到相关方法,请高手解答,谢谢! 帮你顶。。。 去官网搜搜 gpo,很早以前见过 #include <lsasecur.au3>
$aAudit = _SePolicyQueryAuditEvent(@ComputerName) ; Audit Policy
__SeArrayDisplay($aAudit, "Audit Policy")
Const $tagUSER_MODALS_0 = "long MinPswdLen;long MaxPswdAge;long MinPswdAge;long ForceLogoff;long PswdHistLen"
Const $tagUSER_MODALS_3 = "long LockoutDuration;long LockoutObservationWindow;long LockoutThreshold"
$pPswdPolicy = _SeGetUserModals(0, @ComputerName) ; Password Policy
$tPswdPolicy = DllStructCreate($tagUSER_MODALS_0, $pPswdPolicy)
; Minimum password length.
DllStructGetData($tPswdPolicy, "MinPswdLen")
; Maximum password age.
DllStructGetData($tPswdPolicy, "MaxPswdAge")
; Minimum password age.
DllStructGetData($tPswdPolicy, "MinPswdAge")
; Length of the password history maintained.
DllStructGetData($tPswdPolicy, "PswdHistLen")
$pLockPolicy = _SeGetUserModals(3, @ComputerName) ; User Lockout Policy
$tLockPolicy = DllStructCreate($tagUSER_MODALS_3, $pLockPolicy)
; How long a locked account remains locked before it is automatically unlocked.
DllStructGetData($tLockPolicy, "LockoutDuration")
; The maximum time, in seconds, that can elapse between any two failed logon attempts before lockout occurs.
DllStructGetData($tLockPolicy, "LockoutObservationWindow")
; The number of invalid password authentications that can occur before an account is marked "locked out."
DllStructGetData($tLockPolicy, "LockoutThreshold") 新人看得头晕晕的 本帖最后由 jy010 于 2011-5-22 23:23 编辑
谢谢pusofalse大大 ,已经解决 还有问下“密码必须符合复杂性要求” 没有获取到是否启用?,请教如何获取?
下面是经pusofalse大大指点,通过以上代码编写的程序
p版神贴,留名备学 谢谢pusofalse大大 ,已经解决 还有问下“密码必须符合复杂性要求” 没有获取到是否启用?,请教如何获取? ...
jy010 发表于 2011-5-22 23:20 http://www.autoitx.com/images/common/back.gif
还有人写这个,不错了。 wmi,学习... 学习了。。。。。 顺便顶下楼主和afan 回复 8# redapple2008
单位保密检查 用户自查需要的 回复 6# jy010
不会了。当时也想获取这个选项,查了很多资料没找到,不知怎么获取。跟踪一下注册表试试。 留个记号。。学习下 留名学习!
页:
[1]
2