The Microsoft Win32 functions for working with the service control manager (SCM) on a host server use the "<domain>\<username>" format for service accounts. For example, if you call the QueryServiceConfig function to retrieve the user account under which your service runs, the function returns the name in "Fabrikam\jeffsmith" format. To bind to the user account in the directory, for example to change the account password, the distinguished name of the account is required, which has the format "CN=Jeff Smith,CN=Users,DC=Fabrikam,DC=COM".
To convert between the various name formats, use the TranslateName function, which can convert a name to other formats, such as a user principal name (UPN).
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
