我知道,我们可以得到这样的 DirectoryEntry:
string conPath = "LDAP://10.0.0.6/DC=wds,DC=gaga,DC=com";
string conUser = "administrator";
string conPwd = "Iampassword";
DirectoryEntry de = new DirectoryEntry(conPath, conUser, conPwd, AuthenticationTypes.Secure);
我们可以像这样更改用户的密码:
DirectorySearcher deSearch = new DirectorySearcher();
deSearch.SearchRoot = de;
deSearch.Filter = String.Format("sAMAccountName={0}", "xumai");
SearchResultCollection results = deSearch.FindAll();
foreach (SearchResult objResult in results)
{
DirectoryEntry obj = objResult.GetDirectoryEntry();
obj.Invoke("setPassword", new object[] { "Welcome99" });
obj.CommitChanges();
}
如果使用
string x = obj.Guid.ToString();;
我们可以得到用户的objectGUID“0b118130-2a6f-48d0-9b66-c12a0c71d892”
我怎样才能改变它是密码基础这个objectGUID?
如何搜索用户群这个objectGUID表单“LDAP://10.0.0.6/DC=wds,DC=gaga,DC=com”?
有什么办法过滤吗?等 strFilter = "(&(objectGUID=0b118130-2a6f-48d0-9b66-c12a0c71d892))";
希望得到你的帮助
谢谢。