Adding an Object to the Directory

You can add an object to the directory by using the directory access functions.

    To add a directory object
  1. Call either the DAPIWrite function or the BatchImport function.
  2. If you use the DAPIWrite function, pass DAPI_WRITE_CREATE in the dwFlags parameter. This indicates that 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.
  3. If you use the BatchImport function, specify an import file in the pszImportFile member of the BIMPORT_PARMS structure.

For more information about import files, see Directory Access Function Files.