[英]How to get Domains from a forest from Active Directory over LDAP SSL in c#
[英]How to connect to ldap data source other than Active Directory from c# code?
我期待从Active Directory以外的ldap数据源连接和检索数据。 我尝试使用DirectoryEntry,但它适用于Active Directory对象,因此似乎不能与其他人一起使用。 c#中还有其他选项来连接和从ldap源获取数据吗?
DirectoryEntry de = new DirectoryEntry(LDAP://127.0.0.1/CN=Users,dc=test,dc=com", UserName, Password, AuthenticationTypes.Secure);
DirectorySearcher ds = new DirectorySearcher(de);
ds.FindOne();
1.用您的IP替换“127.0.0.1”。 2. UserName = LDAP用户名3. Passwoed = LDAP用户密码。 4. DC(域组件)=您的域组件5. CN(公用名)=您的公用名此代码可用于连接LDAP服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.