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 pValuesparameters, 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.
If you use the BatchImport function, specify an import file in the pszImportFile member of the BIMPORT_PARMS structure.