I have a service that I had to log on to the local admin to install. The pupose of this service to log when a user is logging in or out to record their username. I finally f
Try to change the Account() method inserting the sessionId parameter and passing the changeDescription.SessionId to the method WTSQueryUserToken
public static string Account(uint sessionId)
{
IntPtr token = IntPtr.Zero;
String account = String.Empty;
if (WTSQueryUserToken(sessionId, out token))
{
...
...
p.s.: Run your service with LocalSystem account