Can system service identify current active user?

F

Frank Meng

Hi.
Can system service identify current active user with .net?
I need current active user's logon name from system service.
I tried WindowsIdentity.GetCurrent().Name and it gave me "NT
AUTHORITY\SYSTEM" even I did logon.
Thank you for your help in advance.
Frank
 
F

Frank Meng

"System.Environment.UserName" returned the result as "SYSTEM".
Because I logged in as "frank", I wish I could get username "frank".
I am testing it on Win2K. But I think it should be the same on WinXP.
Frank
 
C

Champika Nirosh

I am also working in win2k professional edition and I get the user name
which I used to log
 
P

Peter Venter

You can use WMI's Win32_LoggedOnUser, but this is only supported in
Win-XP and Windows 2003. Does this need to work on Win2K ?
 
F

Frank Meng

I am running my application as a system service with LocalSystem account.
Are you running your application with LocalSystem account?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top