我有这个 LDAP 连接字符串:connectionString="LDAP://username:password@10.10.10.246:389/DC=ABC,DC=local"
活动目录服务器ABC.local
带有 IP 10.10.10.246
。
我正在使用此代码从活动目录中读取属性:
MembershipSection membershipSection = (MembershipSection)WebConfigurationManager.GetSection("system.web/membership");
string defaultProvider = membershipSection.DefaultProvider;
ProviderSettings providerSettings = membershipSection.Providers[defaultProvider];
string connectionStringName = providerSettings.Parameters["connectionStringName"];
string connectionString = WebConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
DirectoryEntry ent = new DirectoryEntry(connectionString);
string name = ent.Properties["l"].Value.ToString();
string Language = ent.Properties["st"].Value.ToString();
但出现一个错误说"The server is not operational."
。我是在用连接字符串做任何事情还是正在发生什么。你帮帮我好吗?