Novell is now a part of Micro Focus

How can you add an auxiliary class to...

Articles and Tips: qna

01 Oct 2003


Q.

How can you add an auxiliary class to users using an ActiveX control? I need to add posixAccount to many users and set the UID, GID, and homeDirectory attributes. I'm using eDirectory 8.7, so auxillary classes are supported.

The auxillary class I'm using already exists and I can manually add it to users using ConsoleOne, and set the required fields. I just need to be able to do it through a program.

A.

To programatically add an auxiliary class to an object instance, you need to add the auxillary class to the list of objectclass definitions. If you are using the LDAP control (nwidir), it's easy with the addfieldvalue("objectclass", "myauxclass") method.

If you are using the NDAP control (nwdir), there is no addfieldvalue method, so you need to use getfieldvalue("objectclass") to read the existing objectclasses into an array, resize the array (in Visual Basic it's redim preserve) and add the auxillary class to the array. Then run setfieldvalue with the array as the contents. By the way, the documentation is wrong for this control where it just shows adding the one auxillary class value. This has been reported as a bug.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates