| Author |
Can system service identify current active user?
|
|
| Frank Meng 2004-03-28, 10:28 pm |
| 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
| |
| Peter Venter 2004-03-28, 10:28 pm |
| This on a win-xp machine ?
| |
| Frank Meng 2004-03-28, 10:28 pm |
| "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
"Champika Nirosh" <nospam@textcentric.lk> wrote in message news:<ecHuzAT8DHA.712@tk2msftngp13.phx.gbl>...[color=darkred]
> System.Environment.UserName
>
> Nirosh
>
> "Frank Meng" <mengfrank@hotmail.com> wrote in message
> news:1a370138.0402110903.417727d8@posting.google.com...
| |
| Peter Venter 2004-03-28, 10:28 pm |
| 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 ?
|
|
|
|