加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 以编程方式读取本地密码策略

发布时间:2020-12-13 20:42:26 所属栏目:Windows 来源:网络整理
导读:是否有Windows API函数允许读取当前密码策略是什么?例如,最小长度,复杂性等. 如果没有阅读,有没有办法以编程方式验证策略的密码? 请参阅 Security Watch Windows Domain Password Policies.您可以使用 ADSI或其包装来命中AD.我找到了 VBScript sample.您可
是否有Windows API函数允许读取当前密码策略是什么?例如,最小长度,复杂性等.

如果没有阅读,有没有办法以编程方式验证策略的密码?

请参阅 Security Watch Windows Domain Password Policies.您可以使用 ADSI或其包装来命中AD.我找到了 VBScript sample.您可以将其翻译成您想要的任何语言:
Sub ListPasswordPolicyInfo( strDomain )
    Dim objComputer
    Set objComputer = GetObject("WinNT://" & strDomain )
    WScript.Echo "MinPasswordAge: " &  ((objComputer.MinPasswordAge) / 86400)
    WScript.Echo "MinPasswordLength: " &  objComputer.MinPasswordLength
    WScript.Echo "PasswordHistoryLength: " &  objComputer.PasswordHistoryLength
    WScript.Echo "AutoUnlockInterval: " &  objComputer.AutoUnlockInterval
    WScript.Echo "LockOutObservationInterval: " &  objComputer.LockOutObservationInterval
End Sub

Dim strDomain
Do
    strDomain = inputbox( "Please enter a domainname","Input" )
Loop until strDomain <> ""

ListPasswordPolicyInfo( strDomain )

作为奖励,请查看LDAP Admin.它是一个开源的LDAP目录编辑器,您可以使用它来测试事物,并检查用Delphi编写的代码.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读