是否有Windows API函数允许读取当前密码策略是什么?例如,最小长度,复杂性等.
如果没有阅读,有没有办法以编程方式验证策略的密码?
请参阅安全性监视Windows域密码策略.您可以使用ADSI或其包装器来命中AD .我找到了一个VBScript样本.您可以将其翻译成您想要的任何语言:
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管理员.它是一个开源的LDAP目录编辑器,您可以使用它来测试事物,也可以检查用Delphi编写的代码.