How do I get the logged-in user from a service?

Razor1973

Newcomer
Joined
Dec 10, 2003
Messages
1
Location
Miami, Florida
Hello there! First time poster here.

I have just created a service in C# that uses LocalSystem as the account to start the service.

In my service, I need to determine who the user logged in on the PC is and I still haven't found a way to do this.

WindowsIdentity.GetCurrent().Name does not work, as it returns NT ACCOUNT\SYSTEM.

What should I do?

TIA
 
Back
Top