Skip to content

Latest commit

 

History

History
119 lines (93 loc) · 4.15 KB

nf-certbcli-certsrvisserveronlinew.md

File metadata and controls

119 lines (93 loc) · 4.15 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:certbcli.CertSrvIsServerOnlineW
CertSrvIsServerOnlineW function (certbcli.h)
Determines if a Certificate Services server is online; if the Certificate Services server is not online, backup operations will not be successful.
CertSrvIsServerOnline
CertSrvIsServerOnline function [Security]
CertSrvIsServerOnlineW
_certsrv_certsrvisserveronline
certbcli/CertSrvIsServerOnline
certbcli/CertSrvIsServerOnlineW
security.certsrvisserveronline
security\certsrvisserveronline.htm
security
fce1ea87-6c02-433e-af38-99b33528b1f1
12/05/2018
CertSrvIsServerOnline, CertSrvIsServerOnline function [Security], CertSrvIsServerOnlineW, _certsrv_certsrvisserveronline, certbcli/CertSrvIsServerOnline, certbcli/CertSrvIsServerOnlineW, security.certsrvisserveronline
certbcli.h
Certsrv.h
Windows
None supported
Windows Server 2003 [desktop apps only]
CertSrvIsServerOnlineW (Unicode)
Certadm.lib
Certadm.dll
Windows
19H1
CertSrvIsServerOnlineW
certbcli/CertSrvIsServerOnlineW
c++
APIRef
kbSyntax
DllExport
Certadm.dll
CertSrvIsServerOnline
CertSrvIsServerOnlineW

CertSrvIsServerOnlineW function

-description

The CertSrvIsServerOnline function determines if a Certificate Services server is online; if the Certificate Services server is not online, backup operations will not be successful.

-parameters

-param pwszServerName [in]

A pointer to the NetBIOS or DNS machine name of the server to check for online status.

-param pfServerOnline [out]

A pointer to Boolean value which will be TRUE if the Certificate Services server is online and FALSE if it is not online.

-returns

The return value is an HRESULT. This function will fail if Certificate Services is not running. If Certificate Services is running and ready to accept requests, this function will return S_OK, and *pfServerOnline will point to a value of TRUE. If Certificate Services is running in suspended (or paused) mode, this function will return S_OK, and *pfServerOnline will point to a value of FALSE.

-remarks

Call this function to determine whether a Certificate Services server is online and available for backup operations.

This function's name in Certadm.dll is CertSrvIsServerOnlineW. You must use this form of the name when calling GetProcAddress. Also, this function is defined as type FNCERTSRVISSERVERONLINEW in the Certbcli.h header file.

Examples

FNCERTSRVISSERVERONLINEW* pfnOnline = NULL;
char * szOnlineFunc = "CertSrvIsServerOnlineW";
BOOL       bOnline = 0;
HRESULT    hr = 0;

// Get the address of the function.
// hInst was set by calling LoadLibrary for Certadm.dll.
pfnOnline = (FNCERTSRVISSERVERONLINEW*) GetProcAddress(hInst,
                                        szOnlineFunc );
if ( NULL == pfnOnline )
{
    printf("Failed GetProcAddress - %s, error=%d\n",
           szOnlineFunc,
           GetLastError() );
    exit(1);  // Or other appropriate error action.
}

// Call the function; wszServer was set earlier to the server name.
hr = pfnOnline(wszServer, &bOnline);
if (FAILED(hr))
{
    printf("Failed pfnOnline, hr=%x, err=%d\n",
           hr,
           GetLastError());
    exit(1);  // Or other appropriate error action.
}

// Display the online status.
printf("Server is %s\n", 
       (bOnline ? "Online" : "Suspended" ));

-see-also

CertSrvBackupPrepare

Using the Certificate Services Backup and Restore Functions