Platform SDK: Active Directory, ADSI, and Directory Services

IDsAdminCreateObj::Initialize

The Initialize method initializes the IDsAdminCreateObj interface with information about the container where the object will be created, the class of the object to be created and, possibly, the copy source.

HRESULT Initialize(
  IADsContainer *pADsContainerObj, 
  IADs pADsCopySource, 
  LPCWSTR lpszClassName 
);

Parameters

pADsContainerObj
[in] Pointer to the IADsContainer interface of an existing container where the object will be created. This parameter must not be NULL.
pADsCopySource
[in] Pointer to the IADs interface of the object from which the copy will be made, if a copy operation is required. If a copy operation is not required, this parameter must be NULL.

Note  The copy operation is only supported on user objects. Therefore, lpszClassName must contain "user", if the copy operation is required.

lpszClassName
[in] Pointer to a string containing the LDAP name of the object class to be created. This parameter must not be NULL. The following values are supported for this parameter; User, Computer, PrintQueue, Group and Contact.

Return Values

If the method is successful, the return value is S_OK.

If an error occurs, the return value is a COM error code. For more information, see Error Handling.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Dsadmin.h.

See Also

Active Directory Admin Interfaces, IDsAdminCreateObj, IDsAdminCreateObj::CreateModal