I'm new in Ldap now I tried changed ldap records' password with c#. for example; users in ldap username:12345678900 password:78900 I can do bellow with help
try
{
searchRoot = new DirectoryEntry(String.Format("LDAP://{0}/{1}",
domainController, container),
adminUser, adminPassword, authenticationTypes);
searcher = new DirectorySearcher(searchRoot);
searcher.Filter = String.Format("sAMAccountName={0}", userName);
searcher.SearchScope = SearchScope.Subtree;
searcher.CacheResults = false;
SearchResult searchResult = searcher.FindOne();
catch (Exception ex)
{
return ex.ToString();
}
how to do I?
答案 0 :(得分:0)
我不熟悉C#LDAP API,但它看起来与JNDI类似,SearchResult
为您提供Context
或DN,您可以从中获得Context
通过查找,然后您可以通过Context
更改属性。