//增加用户
string dom ="LDAP://intdomain.com/CN=Users,DC=intdomain,DC=com";
System.DirectoryServices.DirectoryEntry entry1 = new System.DirectoryServices.DirectoryEntry(dom);

DirectoryEntries myEntries = entry1.Children;
 DirectoryEntry myDirectoryEntry = myEntries.Add("CN=myuser", "user");
  myDirectoryEntry.Properties["givenname"].Value="test";
  myDirectoryEntry.Properties["sn"].Value="htestsn";
  myDirectoryEntry.Properties["displayname"].Value="testdisplayname";   
myDirectoryEntry.Properties["mail"].Value="testmail";
 myDirectoryEntry.CommitChanges();

//设置密码.
myDirectoryEntry.Invoke(“SetPassword“,newPassword);

相关文章:

  • 2021-12-24
  • 2022-12-23
  • 2021-11-14
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-08-02
相关资源
相似解决方案