Directory Services

DsIsNTDSOnline

The DsIsNTDSOnline function verifies that the Windows NT/Windows 2000 Active Directory service is online on the specified server.

HRESULT DsIsNTDSOnline(
  LPCTSTR szServerName,
  BOOL* pfNTDSOnline
);

Parameters

szServerName
[in] Pointer to a null-terminated string that contains the name of the server to verify. Preceding backslashes are optional. An example of a server name is \\server1.
pfNTDSOnline
[out] Pointer to BOOL value that receives the result. Receives TRUE if the directory is online; otherwise, FALSE.

Return Values

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

Remarks

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

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Ntdsbcli.h.
Library: Use Ntdsbcli.lib.

See Also

Backing Up and Restoring Active Directory, Directory Backup Functions