是否有Windows API函数允许读取当前密码策略是什么?例如,最小长度,复杂性等.
如果没有阅读,有没有办法以编程方式验证策略的密码?
请参阅
Security Watch Windows Domain Password Policies.您可以使用
ADSI或其包装来命中AD.我找到了
VBScript sample.您可以将其翻译成您想要的任何语言:
原文链接:https://www.f2er.com/windows/372114.htmlSub 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编写的代码.