Last post Jan 13, 2012 10:46 AM by pantonis
Jan 13, 2012 08:58 AM|pantonis|LINK
I'm want to be able to get the user groups that a user belongs to in an AD where the process that runs the code is not member of the domain.
Can you tell me how to do that?
Jan 13, 2012 10:12 AM|smirnov|LINK
Usually, you should be able to that even the process runs with local (system) account (and server is a member of domain).
To get groups for specific user, try
DirectoryEntry de = new DirectoryEntry("LDAP://...");
DirectorySearcher ds = new DirectorySearcher(de);
ds.SearchScope = SearchScope.Subtree;
ds.Filter = "(sAMAccountName=jdoe)"; // your username
SearchResult result = ds.FindOne();
foreach (string g in result.Properties["memberOf"])
Jan 13, 2012 10:13 AM|pantonis|LINK
What about AccountManagement. How can I do it?
Jan 13, 2012 10:27 AM|smirnov|LINK
Jan 13, 2012 10:46 AM|pantonis|LINK