By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,459 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,459 IT Pros & Developers. It's quick & easy.

Can system service identify current active user?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
This on a win-xp machine ?
Nov 15 '05 #3

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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.