How to resolve “The server does not support the control. The control is critical.” Active Directory error

后端 未结 3 1317
礼貌的吻别
礼貌的吻别 2020-12-21 08:10

When trying to get all users from AD based on a role I was getting the exception:

System.DirectoryServices.Protocols.DirectoryOperationException: The

3条回答
  •  离开以前
    2020-12-21 08:59

    It is true that it helps to change from AuthType.Basic, but in case anyone wants to get it working with AuthType.Basic then you need to make sure to set LDAP protocol version to 3:

    var connection = new LdapConnection(new LdapDirectoryIdentifier(server), null, AuthType.Basic);
    connection.Bind(new NetworkCredential(username, password));
    connection.SessionOptions.ProtocolVersion = 3;
    

    I found this solution here: https://groups.google.com/d/msg/microsoft.public.active.directory.interfaces/x1ZiixXknqk/m7-Li21QBoIJ

提交回复
热议问题