Получение значения необработанного свойства с помощью .NET DirectoryServices - PullRequest
1 голос
/ 19 февраля 2011

Кто-нибудь знает, возможно ли получить значение любого свойства объекта LDAP X? Похоже, что .NET или ADSI удаляет вещи, которые он не может обработать (de.Properties.Values.Count == de.Properties.PropertyNames.Count> de.Properties.Values.props.valueTable.Count).

        binddn.Text = "cn=admin,o=system";
        bindpass.Password = "XXXXX";
        server.Text = "10.X.X.X";
        basedn.Text = "cn=server,o=system";
        StringBuilder basepath = new StringBuilder("LDAP://");
        basepath.Append(server.Text).Append("/").Append(basedn.Text);

        DirectoryEntry myDirectoryEntry = new DirectoryEntry(basepath.ToString());
        myDirectoryEntry.Username = binddn.Text;
        myDirectoryEntry.Password = bindpass.Password;
        myDirectoryEntry.AuthenticationType = AuthenticationTypes.ServerBind;

        foreach (string key in myDirectoryEntry.Properties.PropertyNames)
        {
            object val = myDirectoryEntry.Properties[key].Value;

        }

Это происходит сбой в свойстве networkAddress, являющемся двоичным полем (http://ldapwiki.willeke.com/wiki/Ldapsearch%20Networkaddress).

...