473,587 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can a service running as NetworkService see logged on users?

I've got a windows service running as NetworkService on a WinXP Pro
machine. Is there a way for it to find the Active Directory account of
the logged on user? I don't mind switching the service to run as a
"Domain Admin" if needed, but I *need* to find out the LDAP path for the
user.

Thanks!
Nov 17 '05 #1
1 1249
"Stephen Corey" <swc@_NOSPAM_wa rdandsmith.com> wrote in message
news:u$******** ******@tk2msftn gp13.phx.gbl...
I've got a windows service running as NetworkService on a WinXP Pro
machine. Is there a way for it to find the Active Directory account of the
logged on user? I don't mind switching the service to run as a "Domain
Admin" if needed, but I *need* to find out the LDAP path for the user.


There isn't necessarily a _single_ logged on user in light of terminal
services, fast user switching etc.

That said, this link

http://msdn.microsoft.com/library/de...n_sessions.asp

shows how to enumerate all of logons on a system and this link

shows how to get information about each one:

http://msdn.microsoft.com/library/de...nformation.asp

The two links should get you started. Please post follow-up in the kernel
group:

microsoft.publi c.win32.program mer.kernel

Regards,
Will
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3826
by: Andrew Weaver | last post by:
How do you change the port in which CDONTS will look for Microsoft SMTP server? I have Imail running on port 25, and I have SMTP service running on port 26. Any help you can provide me would be excellent. Thanks, -Drew
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
1
2588
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a value of this user id stored in the table among the other fields in the form which are filling in. After clicking on the button "Log off" the value of...
3
2198
by: jliusolar | last post by:
Hi I am trying to figure out why an application get this error when I am trying to open the application's asmx file from localhost. I don't have indexing service running(it set as manual and not started). I also created an .aspx file to do testing The .aspx file opens fine in other directory from IE. As long as I put it in the application's...
0
1117
by: Jennyfer J Barco | last post by:
Hello, I have a .NET service running and sometimes, not very often I receive this error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. General network error. Check your network documentation" I don't know what is causing it. My web server is in one server and my SQL is in a...
2
2949
by: SStory | last post by:
I have a service which has no U/I, that I use to ensure a certain tray application is running. I would like for the service which runs under "Local System", to create the process as a normal app for the user currently logged in.... Is there a way to do it.... or is there a way for a winforms app launched by a user to communicate with a...
0
1464
by: nrworld | last post by:
Hi, I have a requirement to find the users logged in to a XP system using a C# service which is running as SYSTEM service. An additional requirement is to start an application on the Active Desktop users as that user. The application should be spawned by the service, is this possible if the user account is password protected and The service...
2
11937
by: Bill Fuller | last post by:
I am trying to attach to a WCF Web Service running in virtual directory in my local dev box, but not sure how to do it. I tried setting a breakpoint on the .svc and attaching to the Inetinfo process, but it doesn't break. I am getting a SQL connection error, but the message is rather vague. The web.config connecton string looks fine.
13
6723
by: snowinfo | last post by:
Hi all, any way to count the number of users i have logged into my site? any help/code appreciated, craig
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
8205
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
8339
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
6619
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.