PowerShell Remoting Lync,搜索域控制器时发生Active Directory错误“ -2147016672”
|
我正在尝试通过WcfService配置LyncServer,该服务本身会执行PowerShell远程处理以在Lync计算机上运行Cmdlet。我成功导入了Lync模块,但是当我尝试调用和Lync cmdlet时,例如Get-CsUser我在powershell.Streams.Error中收到错误:
搜索域控制时发生Active Directory错误“ -2147016672”
域\“ my.test.domain \”中的管理员:\“发生操作错误。”
这就是我创建运行空间的方式:
PSCredential psCred = new PSCredential(this.Credentials.Domain + \"\\\\\" + this.Credentials.UserName, this.Credentials.SecurePassword);
WSManConnectionInfo wsman = new WSManConnectionInfo(uri, c_powerShellShema, psCred);
wsman.AuthenticationMechanism = AuthenticationMechanism.Default;
//wsman.AuthenticationMechanism = AuthenticationMechanism.Kerberos;
//wsman.ProxyAuthentication = AuthenticationMechanism.Negotiate;
Runspace retval = RunspaceFactory.CreateRunspace();//wsman);
retval.Open();
和我的powershell电话
PowerShell powerShell = PowerShell.Create();
powerShell.Runspace = this.Runspace;
powerShell.AddScript(\"Import-Module Lync\");
powerShell.Invoke();
powerShell.Streams.ClearStreams();
powerShell.AddScript(\"Get-CsUser);
powerShell.Commands.AddCommand(\"Out-String\");
var retval = powerShell.Invoke();
foreach (var o in retval)
Console.WriteLine(o.ToString());
foreach (var e in powerShell.Streams.Error)
Console.WriteLine(e.ToString());
任何想法?运行空间中使用的用户与我以前通过lync管理控制台执行所有lync配置的用户相同,因此他具有所需的所有访问权限。
没有找到相关结果
已邀请:
3 个回复
邵酮
挂帘妈乡
,我工作正常。
掸牛浓疗
而任何商务用lync / skype命令(例如Get-CsUser或Enable-CsUser或Disable-CsUser)都会从您的服务器连接域控制器。 因此,在连接到DC时,呼叫不会指定用户要使用的凭据,因为您提供的凭据仅用于目标(Skype服务器)而不是DC。 因此,只要涉及多个跃点,就必须使用CredSSP,因为CredSSP会告诉您在连接到下一跃点时使用相同的凭据。 您可以参阅本文,它比我可能拥有的更好地解释了方式。 https://sysnetdevops.com/2016/09/16/skype-for-business-server-and-powershell-remoting/