服务器设置密码失败。
Exception.message:
Exception has been thrown by the target of an invocation
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
那么为什么这个调用会在本地(开发人员)机器上工作,但不能在服务器上工作?
` DirectoryEntry entry = new DirectoryEntry(..);
entry.AuthenticationType = AuthenticationTypes.Secure;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(&(sAMAccountName=" + userName_ + "))";
DirectoryEntry userEntry = search.FindAll()[0].GetDirectoryEntry();
userEntry.Invoke("SetPassword", new object[] {password@12345#"
userEntry.CommitChanges();`
编辑:InnerException 是 {“RPC 服务器不可用。(来自 HRESULT 的异常:0x800706BA)”}