HrGetServiceAccountName

The HrGetServiceAccountName function obtains the account name for a service.

Quick Info

Header file: EXCHINST.H
Library: EXCHINST.LIB

HRESULT HrGetServiceAccountName(
  LPSTR lpszServiceName,  
  LPSTR * lppszAccountName  
);
 

Parameters

lpszServiceName
Input parameter. Points to a null-terminated string containing the name of the service.
lppszAccountName
Output parameter. Points to the address of a null-terminated string containing the Windows NT user name of the person who administers the service.

The account name has the following format:

DomainName\UserName

If the returned value is .\UserName, the account belongs to the built-in domain. If the returned value is NULL, the service is logged in under the LocalSystem account.

Return Values

See Return Values.

See Also

HrGetServiceCommonName, HrGetServiceDisplayName, HrGetServiceExecutableName, HrGetServiceObjectGUID, HrGetServiceProductGUID, HrGetServiceServerName, HrGetServiceSiteDN