前几天遇到修改域用户密码报错的问题
DirectoryEntry entry = new DirectoryEntry();
string g_domain = "test.com";
string UserDN = "CN=1111,CN=Users,DC=test,DC=com";
entry.Path = "LDAP://" + g_domain + "/" + UserDN;
string oldpassword = "1234567";
//用户号
entry.Username = "1111@test.com";
//老密码
entry.Password = oldpassword;
//新密码
userpassword = "123456";
entry.Invoke("ChangePassword", new object[] { oldpassword, userpassword });
entry.CommitChanges();
暂时的解决方法是:
修改前要把客户机上的TCP/IP NetBIOS 服务启动