473,587 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ 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().N ame and it gave me "NT
AUTHORITY\SYSTE M" even I did logon.
Thank you for your help in advance.
Frank
Nov 15 '05 #1
6 2822
System.Environm ent.UserName

Nirosh

"Frank Meng" <me*******@hotm ail.com> wrote in message
news:1a******** *************** ***@posting.goo gle.com...
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().N ame and it gave me "NT
AUTHORITY\SYSTE M" 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.Environ ment.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****@textcen tric.lk> wrote in message news:<ec******* ******@tk2msftn gp13.phx.gbl>.. .
System.Environm ent.UserName

Nirosh

"Frank Meng" <me*******@hotm ail.com> wrote in message
news:1a******** *************** ***@posting.goo gle.com...
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().N ame and it gave me "NT
AUTHORITY\SYSTE M" 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*******@hotm ail.com> wrote in message
news:1a******** *************** ***@posting.goo gle.com...
"System.Environ ment.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****@textcen tric.lk> wrote in message

news:<ec******* ******@tk2msftn gp13.phx.gbl>.. .
System.Environm ent.UserName

Nirosh

"Frank Meng" <me*******@hotm ail.com> wrote in message
news:1a******** *************** ***@posting.goo gle.com...
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().N ame and it gave me "NT
AUTHORITY\SYSTE M" even I did logon.
Thank you for your help in advance.
Frank

Nov 15 '05 #5
You can use WMI's Win32_LoggedOnU ser, 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****@textcen tric.lk> wrote in message news:<#k******* *******@TK2MSFT NGP09.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
4944
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 webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or...
15
2001
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 least get the service to launch an application as the current user and not the SYSTEM Many thanks
7
4778
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") When I try to do it, I get this error: System.UnauthorizedAccessException: Access to the path
5
2192
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 have to provide the username and password to login to the application/web service. I need to be able to send the users authenticated security token...
2
1827
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 various server-side structures and database information to be loaded prior to each call. To reduce overhead, we would like to implement some sort of...
18
3399
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 dozens of examples of how to authenticate users against Active Directory, but AD seems to be a different animal than Sun Java System Directory Server....
5
21174
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. (Exception from HRESULT: 0x8007202F)" My code is like this: <code>
0
2006
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 Authentication. Within the Web Service we look at the current username and check which user Groups it belongs to.
6
2392
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 passing username/password to make it more secure. Environment : Web Service/IIS5.0/ASP.NET 2.0 / C#. Kindly help with your suggestions.
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.