Reading MemberUid Attribute From AD LDAP

Good Day

i need to read the values of the attribute MemberUID using ASP.net

Please see attached image
memberuid
LVL 16
Kamal KhaleefaInformation Security SpecialistAsked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
Firstly you'll need to add a reference to the System.DirectoryServices assembly to your project. Then you can use something like the following:
            DirectorySearcher search = new DirectorySearcher("(&(objectClass=group)(Name=testgroup))");
            search.PropertiesToLoad.AddRange(new string[] { "MemberUID" });

            SearchResult result = search.FindOne();
            if (result.Properties["MemberUID"].Count > 0)
            {
                string value = result.Properties["MemberUID"][0].ToString();
            }

Open in new window

You may need to play around with the query a little, depending on your setup.
0
 
Kamal KhaleefaInformation Security SpecialistAuthor Commented:
you give me  a hint  from where to start .

thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.