469,611 Members | 1,711 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

Can system service identify current active user?

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
Nov 15 '05 #1
6 2673
System.Environment.UserName

Nirosh

"Frank Meng" <me*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
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

Nov 15 '05 #2
This on a win-xp machine ?
Nov 15 '05 #3
"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" <no****@textcentric.lk> wrote in message news:<ec*************@tk2msftngp13.phx.gbl>...
System.Environment.UserName

Nirosh

"Frank Meng" <me*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
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

Nov 15 '05 #4
I am also working in win2k professional edition and I get the user name
which I used to log

"Frank Meng" <me*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
"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" <no****@textcentric.lk> wrote in message

news:<ec*************@tk2msftngp13.phx.gbl>...
System.Environment.UserName

Nirosh

"Frank Meng" <me*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
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

Nov 15 '05 #5
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 ?
Nov 15 '05 #6
I am running my application as a system service with LocalSystem account.
Are you running your application with LocalSystem account?

"Champika Nirosh" <no****@textcentric.lk> wrote in message news:<#k**************@TK2MSFTNGP09.phx.gbl>...
I am also working in win2k professional edition and I get the user name
which I used to log

Nov 15 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Penn Markham | last post: by
7 posts views Thread by Peter Afonin | last post: by
2 posts views Thread by theGecko | last post: by
5 posts views Thread by Peter Bradley | last post: by
6 posts views Thread by =?Utf-8?B?SWJyYWhpbS4=?= | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.