服务器中的设置密码失败。
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)”}
答案 0 :(得分:0)
该应用是否在两种环境下的同一帐户下运行?如果没有,那么根据您的问题,它可能是权限问题