> 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/default.asp?url=/library/en-us/secauthn/securi
ty/enumerating_logon_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/default.asp?url=/library/en-us/secauthn/securi
ty/retrieving_logon_session_information.asp
The two links should get you started. Please post follow-up in the kernel
group:
microsoft.public.win32.programmer.kernel
Regards,
Will