문제

I see that this has been asked quite a few times but I think I'm taking a different approach to the problem. I have an LDAP connection string that is working - it connects to a group. Something like the following:

var myGrp = new DirectoryEntry("LDAP://server.domain.com:389/CN=GroupName,OU=RAM,OU=Groups,DC=region,DC=company,DC=com");
            myGrp.Username = "username";
            myGrp.Password = "password";

Now, I can print myGrp.Name without any issues. I would now like to list all members of this group, but I'm not sure where to begin. Any pointers would be awesome.

도움이 되었습니까?

해결책

I tried this and it worked perfectly:

foreach (object dn in myGrp.Properties["member"])
            {
                Console.WriteLine(dn);
            }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top