NetIsServiceAccount function (lmaccess.h)

The NetIsServiceAccount function tests whether the specified standalone managed service account (sMSA) or group managed service account (gMSA) exists in the Netlogon store on the specified server.

This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Logoncli.dll.

Syntax

NTSTATUS NetIsServiceAccount(
  [in, optional] LPWSTR ServerName,
  [in]           LPWSTR AccountName,
  [out]          BOOL   *IsService
);

Parameters

[in, optional] ServerName

The value of this parameter must be NULL.

[in] AccountName

The name of the account to be tested.

[out] IsService

TRUE if the specified service account exists on the specified server; otherwise, FALSE.

Return value

If the function succeeds, it returns STATUS_SUCCESS.

If the function fails, it returns an error code.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header lmaccess.h
DLL Netapi32.dll

See also

NetAddServiceAccount

NetEnumerateServiceAccounts

NetRemoveServiceAccount