NetIsServiceAccount function

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(
  LPWSTR ServerName,
  LPWSTR AccountName,
  BOOL   *IsService
);

Parameters

ServerName

The value of this parameter must be NULL.

AccountName

The name of the account to be tested.

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

   
Windows version Windows 7 [desktop apps only] Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header lmaccess.h
DLL Netapi32.dll

See Also

NetAddServiceAccount

NetEnumerateServiceAccounts

NetRemoveServiceAccount