To find an object in the directory, you can either use the DAPIWrite or BatchImport directory access function, or you can use the MAPI address book interface.
To add a directory object using DAPIWriteCall the DAPIWrite directory access function. Pass DAPI_WRITE_CREATE in the dwFlags parameter to indicate you want to create an object. (If the object already exists, the call to DAPIWrite fails.) In the pAttributes and pValues parameters, pass pointers to DAPI_ENTRY structures that contain the names of attributes to be written to the directory and the values for those attributes, respectively.
To add a directory object using BatchImportCall the BatchImport directory access function and specify an import file in the pszImportFile member of the BIMPORT_PARMS structure.
To find a directory object using MAPI functions