Export (0) Print
Expand All

DsRemoveDsDomain function

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

Syntax


DWORD DsRemoveDsDomain(
  _In_  HANDLE hDs,
  _In_  LPTSTR DomainDN
);

Parameters

hDs [in]

Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.

DomainDN [in]

Pointer to a null-terminated string that specifies the distinguished name of the naming context to remove from the directory service.

Return value

Returns ERROR_SUCCESS if successful or a Win32 or RPC error code if unsuccessful. Possible error codes include the following.

Return codeDescription
ERROR_DS_CANT_DELETE

The domain object cannot be deleted because there are still domain controllers that host that domain.

ERROR_DS_ILLEGAL_MOD_OPERATION

The domain object being deleted is bound to by hDs.

ERROR_DS_NC_STILL_HAS_DSAS

The domain object cannot be deleted because there are still domain controllers that host that domain.

ERROR_DS_NO_CROSSREF_FOR_NC

A cross reference for the naming context cannot be found.

ERROR_INVALID_PARAMETER

A parameter is invalid.

RPC_S_CANNOT_SUPPORT

The DsRemoveDsDomain function is not supported.

RPC_S_INVALID_VERS_OPTION

A versioning error occurred.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

Active Directory Client Extension on Windows NT 4.0 and Windows Me/98/95

Header

Ntdsapi.h

Library

Ntdsapi.lib

DLL

Ntdsapi.dll

Unicode and ANSI names

DsRemoveDsDomainW (Unicode) and DsRemoveDsDomainA (ANSI)

See also

Domain Controller and Replication Management Functions
DsBind
DsBindWithCred
DsRemoveDsServer

 

 

Show:
© 2014 Microsoft