How do I read adlds schema via C# code

110 Views Asked by At

I am new to AD and adlds and trying to read the schema and not able to get it. Can anyone help me out?? I was trying to connect to ad through below code

 DirectoryEntry entry = new DirectoryEntry(
        "LDAP://CN=Users,DC=addomain,DC=com",
        null,
        null,
        AuthenticationTypes.Secure
        );
        PropertyCollection props = entry.Properties;

        foreach (string propName in props.PropertyNames)
        {
            if (entry.Properties[propName].Value != null)
            {
                Console.WriteLine(propName + " = " + entry.Properties[propName].Value.ToString());
            }
            else
            {
                Console.WriteLine(propName + " = NULL");
            }
        }

OUTPUT:

Click Here to View the Output

I want all the attribute name object name from the ad, but i get this output

0

There are 0 best solutions below