Platform SDK: Active Directory, ADSI, and Directory Services

DsRemoveDsDomain

The DsRemoveDsDomain function removes all traces of a domain naming context (NC) from the global area of the directory service.

DWORD DsRemoveDsDomain(
  HANDLE hDs,
  LPTSTR DomainDN
);

Parameters

hDs
[in] Bind handle to the directory service.
DomainDN
[in] Pointer to a null-terminated Unicode string specifying the distinguished name (DN) of the NC to remove from the directory service.

Return Values

If the function performs its operation successfully, the return value is ERROR_SUCCESS.

If the function fails, the return value can be one of the following.

DS_ERR_CANT_DELETE
The domain object cannot be deleted, because there are still domain controllers that host that domain.
ERROR_INVALID_PARAMETER
A parameter is incorrect.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntdsapi.h.
  Library: Included as a resource in Ntdsapi.dll.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

DC and Replication Management Functions, DsRemoveDsServer