简体   繁体   中英

How to set and get multiple values(array values) to Single attribute in Active Directory using C++ win32 API?

i am using C++ Win32 API.

i have done to connect AD using ldap functions & create a attribute.

i done to set & get single values to attributes from AD.

Now,i want to set multiple values in myown attribute.the attribute name is "UsrAttrib".

how to set array of value into this attribute?

And i already tried to get "objectClass" attribute value,using below code.

usrValue = ldap_get_values(
                          pLdapConnection,  // Session Handle
                          pEntry,           // Current entry
                          "ObjectClass");

the attribute actual value is top;person;organizationalPerson;user

But usrValue only gives top only.

and i check using ldap_count_values it gives 4 .

How to i get all values from that attribute?

To get all of the values of a particular attribute use ldap_count_values and ldap_get_values on the result of a search for the attribute. See the Searching a Directory example.

To set multiple values for a particular attribute you can list them all in the mod_values member of the ldapmod structure, or you can create multiple LDAP_MOD_ADD structures.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM