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

前端之家收集整理的这篇文章主要介绍了windows – 以编程方式读取本地密码策略前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否有Windows API函数允许读取当前密码策略是什么?例如,最小长度,复杂性等.

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

请参阅 Security Watch Windows Domain Password Policies.您可以使用 ADSI或其包装来命中AD.我找到了 VBScript sample.您可以将其翻译成您想要的任何语言:
  1. Sub ListPasswordPolicyInfo( strDomain )
  2. Dim objComputer
  3. Set objComputer = GetObject("WinNT://" & strDomain )
  4. WScript.Echo "MinPasswordAge: " & ((objComputer.MinPasswordAge) / 86400)
  5. WScript.Echo "MinPasswordLength: " & objComputer.MinPasswordLength
  6. WScript.Echo "PasswordHistoryLength: " & objComputer.PasswordHistoryLength
  7. WScript.Echo "AutoUnlockInterval: " & objComputer.AutoUnlockInterval
  8. WScript.Echo "LockOutObservationInterval: " & objComputer.LockOutObservationInterval
  9. End Sub
  10.  
  11. Dim strDomain
  12. Do
  13. strDomain = inputBox( "Please enter a domainname","Input" )
  14. Loop until strDomain <> ""
  15.  
  16. ListPasswordPolicyInfo( strDomain )

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

猜你在找的Windows相关文章