"Ronald S. Cook" <rc***@westinis.comwrote in message
news:eD*************@TK2MSFTNGP04.phx.gbl...
>I have no experience with Active Directory and need to programatically read which user is
logged into the domain, the groups they are in, and any other pertinent information.
Can anyone get me started? I.e. what's the namespace, what does the masic code look like?
Thanks,
Ron
As Marc said, you can't get this from the AD. You'll have to use System.Management and get
the current Instances of Win32_LogonSession on the DC. From these instances you will have to
retrieve the associators to find the UserAccount information.
Note that, you will have to connect to and query all DC's in the domain to get all Logins,
note also that this can be extremely time consuming, especially in large domains.
Willy.