469,579 Members | 1,098 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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 1097
"Stephen Corey" <swc@_NOSPAM_wardandsmith.com> wrote in message
news:u$**************@tk2msftngp13.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.public.win32.programmer.kernel

Regards,
Will
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Marcin Zmyslowski | last post: by
3 posts views Thread by jliusolar | last post: by
reply views Thread by Jennyfer J Barco | last post: by
2 posts views Thread by Bill Fuller | last post: by
13 posts views Thread by snowinfo | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.