473,473 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2818
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
15
by: Sims | last post by:
Hi, I have a service that need to access the current user registry from time to time. But a service only works as a SYSTEM and not as the current user. How can i change that? Or at the very...
7
by: Peter Afonin | last post by:
Hello, I'm using this code to access a network share from an asp.net page: Dim dir As DirectoryInfo = New DirectoryInfo("\\10.0.0.150\FormLib\") Dim files() As FileInfo = dir.GetFiles("*.eps")...
5
by: Buddy Ackerman | last post by:
My app is a .NET forms app that runs in the taskbar and periodically polls a web service. I have a client that wants the app to integrate with their Active Directory. They do not want the user to...
2
by: theGecko | last post by:
I am aware that web services should be entirely stateless and it seems to be recognised as bad design to keep state. BUT, some of the methods we are exposing are extremel complicated and need...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
5
by: Peter Bradley | last post by:
I'm trying to use System.DirectoryServices to update Active Directory from a Web Service. When I try to commit the changes, I get the following error message: "A constraint violation occurred....
0
by: Griff | last post by:
Overview When the first call to our Web Service causes an exception, the Web Service caches that user's credentials for its life time. Details We have a Web Service which uses Windows...
6
by: =?Utf-8?B?SWJyYWhpbS4=?= | last post by:
Hi, I have a client application which Accesses Web Service. but the Web service allows anonymous access to any client request (web/smart client). I want to authenticate every client request by...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.