Exemplo n.º 1
0
 public void SetPasswordTest()
 {
     ADHelper adhelper = new ADHelper("192.168.200.170", "administrator", "yxp.123");
     var u = ADHelper.GetUserEntryByAccount(adhelper.RootEntry, "anhainan1");
     ADHelper.SetPassword(u, "!QAZ2wsx");
     u.CommitChanges(); 
 }
Exemplo n.º 2
0
 public bool IsLoginNameExists(string loginName)
 {
     ADHelper adHelper = new ADHelper(Domain, DomainUser, DomainPass);
     var root = adHelper.GetRootEntry();
     //var rootOrg = ADHelper.GetOrganizeEntry(root, RootName);
     var u = ADHelper.GetUserEntryByAccount(root, loginName);
     if (u != null)
         return true;
     return false;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 登录名是否存在
 /// 空格,null视为存在
 /// </summary>
 /// <param name="loginName"></param>
 /// <returns></returns>
 public bool IsLoginNameExists(string loginName)
 {
     if (string.IsNullOrWhiteSpace(loginName))
         return true;
     ADHelper adHelper = new ADHelper(Domain, DomainUser, DomainPass);
     var root = adHelper.GetRootEntry();
     //var rootOrg = ADHelper.GetOrganizeEntry(root, RootName);
     var u = ADHelper.GetUserEntryByAccount(root, loginName);
     if (u != null || NameList.Contains(loginName))
         return true;
     return false;
 }