Windows LDAP APIを使用してActive Directryからユーザー属性を取得しようとしています。私が使用しています:LDAP C API経由でActive Directoryから特定のユーザー属性を取得する適切な方法は何ですか?
- Active Directoryのバージョン:3
- Wldap32.libバージョン:Windowsの10のx64
例:
PCHAR myAttributes[4];
myAttributes[0] = "DistinguishedName";
myAttributes[1] = "DisplayName";
myAttributes[2] = "PasswordExpired";
myAttributes[3] = "mail";
ldap_search_s(
myLdapConnection, // Ldap connection
myDomain, // DN to start search
LDAP_SCOPE_SUBTREE, // Scope
myFilter, // Filter
myAttributes, // Retrieve list of attributes
0, // Get both attributes and values
&mySearchResult // [out] Search results
);
それはDistinguishedName
、DisplayName
と返します属性ですが、PasswordExpired
属性を返すことはありません。
私はいくつかの他の属性を照会しました。ブール値を持つ属性とEmailAddress
属性を返さないようです。
- なぜ
PasswordExpired
属性が返されないのですか? - 約
EmailAddress
? EmailAddress
とmail
の間に違いはありますか?