IDirectoryObject::CreateDSObject

Creates a child of the current directory service object.

HRESULT CreateDSObject(
  LPWSTR pszRDNName,     //Relative path of new object
  PADS_ATTR_INFO pAttributeEntries,
                         //Attributes to be set
  DWORD dwNumAttributes  //Number of attributes being set
);
 

Parameters

pszRDNName
[in] Relative distinguished name (relative path) of the object to be created.
pAttributeEntries
[in] Array of ADS_ATTR_INFO structures containing attribute definitions to be set when the object is created. Each attribute definition contains the name and initial value of the attribute.
dwNumAttributes
[in] Number of attributes being set when the object is created.

Return Values

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

S_OK
The object was created successfully.

Remarks

All attributes to be initialized on creation must be specified in the pAttributeEntries array. Optional attributes may also be specified.

Once the object is created, the caller can access it by its relative distinguished name. No pointer to the object is necessary.