I tried to get computer principal name of a service running as Network Service
with the following code.
BOOLEAN bError = GetUserNameEx(NameUserPrincipal, buffer, &buf_len);
Since the domain name of my computer is Service-Windows@example.com
, I expect the result in buffer
is the same.
However, the returned service principal name is WIN-SC4RKQUKM4D@example.com
.
I'm sure I've changed my computer and add it into the domain example.com
.
I've no idea about the abnormal principal name. What may be the problem? Any hints will be highly appreciated.
UPDATE
I'm running the service on domain controller, don't know whether this will interfere the result.
Thank you and best regards!