Opening an Object in the Directory
If you know the distinguished name (DN) of an object in the directory, you can open that object using the HrCreateDirEntryIdEx function. For more information on DNs, see Microsoft Exchange Server Addresses.
To open a directory object
-
Start a MAPI session. For information on how to do this, see the first two steps of Opening an Information Store.
-
Open a the address book by calling the IMAPISession::OpenAddressBook method.
-
Obtain an entry identifier for the object by calling the HrCreateDirEntryIdEx function, passing a pointer to the address book (returned in step 2) and the DN of the object.
-
Call the OpenEntry function, passing the entry identifier for the object.