Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to list all currently logged in users in Active Directory (ADAM) using C#?

share|improve this question
Logged into what? – Jim B Jun 3 '11 at 13:12
up vote 1 down vote accepted

Almost certainly not. Active Directory does not maintain a logon-state record.

Based on your other question, you may be able to compare logon/logoff times and guess at the active logged on user. But even this will be just a guess. You might consider something such as a query of the client computer directly using WMI for the logged on user. Users can end an active logon session without a log off event -- think program termination, standby, reset, forced power cycle.

share|improve this answer
I tried researching how to do this before (in other languages)...getting an accurate record for something like this is surprisingly difficult with Windows. – Bart Silverstrim Jun 3 '11 at 12:39

ADAM is an authenticaion provider, so the only auditing capabilities are around who has been querying ADAM. Think of it like an ID badge. You don't query the badge to see what doors it's opened, you query the doors to see what badges opened them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.