none
How can I determine to which group an user is tied with using Active Directory? RRS feed

  • Question

  • Hello,

    I have the following problem: I must determine to which group an user is tied with, when authenticating this user against Active Directory.

    Using the following snipet of code is not much help:

            try {
               string loginPath = "WinNT://" + Environment.MachineName+",computer";     
               AD = new System.DirectoryServices.DirectoryEntry(loginPath);
       System.Collections.ArrayList groups = new System.Collections.ArrayList();
              DirectoryEntries direcEntries = AD.Children;       
            }catch(Exception e) {
               error=true;
               connected=false;
            }

    The ArrayList groups  contains all the users as well as all the groups registrated to my computer. These 2 categories are differentiated by SchemaClassName (User and Group). How can I detemine the group for a specific user?

    I need to make this difference because the actors from my web application have different roles and hence they are placed in 3 distinct groups inside the network. The only credentials that are required at login are username and password and from these credentials I have to split the actors to certain roles.

    Thank you.


    Monday, December 10, 2007 9:28 AM