James Wilson
James Wilson

Reputation: 5150

Active Directory check if user is logged in

I am trying to use active directory to tell if a user is logged in currently. Is this possible with active directory?

I can check what role the user has User.IsInRole(@"domain.com\TeamLead")

But I'm not seeing anything to see if they are currently logged in or not.

Upvotes: 2

Views: 8613

Answers (1)

Lee Harrison
Lee Harrison

Reputation: 2453

By strictly using Active Directory, you will not be able to get this information. Active Directory doesn't store this type of information. You can turn on Login Auditing through GPO and query individuals computers, but that could be messy.

An outside solution could be psloggedon:
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx
Though that is hardly ideal.

AFAIK there is no out of the box datastore that keeps track of which users are currently logged into a domain.

Another alternative could be to craft a logon/logoff script that writes to a particular file/database and you could monitor that file to see who is logged in.

Upvotes: 4

Related Questions