Platform SDK: Active Directory, ADSI, and Directory Services

DsIsNTDSOnline

The DsIsNTDSOnline function checks to see if the Windows NT®/Windows® 2000 Active Directory™ service is online on the specified server. This call is guaranteed to return quickly.

HRESULT DsIsNTDSOnline(
  LPTCWSTR szServerName,
  BOOL *pfNTDSOnline
);

Parameters

szServerName
[in] Specifies the name of the server to back up. Preceding backslashes are optional. An example of a server name is \\server1.
pfNTDSOnline
[out] Pointer to BOOL that will receive the result. TRUE if the directory is online; FALSE otherwise.

Return Values

ERROR_SUCCESS if the call executed successfully; otherwise, a failure code.

Remarks

You should call this function before calling any of the directory backup or restore functions. The directory must be online in order to perform a backup. The directory must by offline to perform a restore.

Requirements

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

See Also

Backing Up and Restoring Active Directory, Directory Backup Functions