LDAP Directory Entry in .Net - not working with OU=Users

后端 未结 3 1133
庸人自扰
庸人自扰 2020-12-10 07:54

I have the following code (C#):

(Tweaked from: http://www.eggheadcafe.com/conversation.aspx?messageid=31766061&threadid=31766050)

DirectorySearcher         


        
3条回答
  •  借酒劲吻你
    2020-12-10 08:17

    This may seem silly and stupid, but the default tree setup in Active Directory is not OU=Users,dc=domain,dc=com but rather cn=Users,dc=domain,dc=com (Note the CN= not the OU= for Users.

    It seems stupid since a container object (objectClass of cn) in AD cannot be a recipient of group policy, but for reasons I do not understand, that is the default. (actually I do understand, it is because containment for a CN is more similar to an NT domain than OU)

    Gets almost everybody I meet, first time they try to LDAP bind/auth to AD.

提交回复
热议问题