Export (0) Print
Expand All

NetEnumerateServiceAccounts function

The NetEnumerateServiceAccounts function enumerates the standalone managed service accounts (sMSA) on the specified server. This function only enumerates sMSAs and not group managed service accounts (gMSA).

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

Syntax


NTSTATUS WINAPI NetEnumerateServiceAccounts(
  _In_opt_  LPWSTR ServerName,
  _In_      DWORD Flags,
  _Out_     DWORD *AccountsCount,
  _Out_     PZPWSTR *Accounts
);

Parameters

ServerName [in, optional]

The value of this parameter must be NULL.

Flags [in]

This parameter is reserved. Do not use it.

AccountsCount [out]

The number of elements in the Accounts array.

Accounts [out]

A pointer to an array of the names of the service accounts on the specified server.

When you have finished using the names, free the array by calling the NetApiBufferFree function.

Return value

If the function succeeds, it returns STATUS_SUCCESS.

If the function fails, it returns an error code.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Lmaccess.h

DLL

Netapi32.dll

See also

NetAddServiceAccount
NetIsServiceAccount
NetRemoveServiceAccount

 

 

Community Additions

ADD
Show:
© 2014 Microsoft