[英]Is it possible to authenticate an Active Directory User with an Expired password?
[英]Query if user has “Cannot change password” checked in Active Directory
我正在嘗試為正在開發的應用檢查此信息...
我正在嘗試查詢userAccountControl,但是我發現如果設置了AD,它將無法正確更新。
這是我當前搜索UserAccountControl的方式
If (res.Properties.Contains("userAccountControl")) Then
userAccountControl = doespasswordexpire(res.Properties("userAccountControl").Item(0))
userAccountControlPNR = PasswordNotRequired(res.Properties("userAccountControl").Item(0))
userAccountControlSCR = SmartCardRequired(res.Properties("userAccountControl").Item(0))
Else
userAccountControl = ""
userAccountControlPNR = ""
userAccountControlSCR = ""
End If
如何在ADSI或LDAP中執行此操作? 我不想使用PrincipalContext。
您不能使用userAccountControl
屬性來修改甚至查詢“無法更改密碼”設置。 它在Microsoft文檔中被列為可能的標記,但是它不起作用(不確定是否曾經打算這樣做)。
要檢查是否已設置,您必須在用戶的DACL中解析出用戶的ACE。 您可以從用戶的ntSecurityDescriptor
屬性中獲取該信息,並以編程方式對其進行解析。 在該線程中有一個很好的起始示例。
一些其他的MSDN信息在這里: https : //msdn.microsoft.com/en-us/library/aa746398.aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.