“连接到与下面的错误消息失败远程服务器:WinRM的不能处理该请求,而使用协商身份验证发生与错误代码0x80090304以下错误:。发生未知安全性错误”WinRM的不能处理该请求
我试图远程运行脚本以非域服务器和客户端也没有域的一部分,因为我们的环境是基于微焦的eDirectory。
我已经配置/试过客户端和服务器上执行以下操作:
winrm quickconfig
WinRM set winrm/config/client @{TrustedHosts="*"}
Set-item wsman:localhost\client\trustedhosts -value *
再次,没有机器是域的一部分,但我认为它会与trustedhosts工作。
代码试图这样来验证容貌:
[xml]$windows=(Get-Content P:\script\windows.xml)
$windows.servers.host | ForEach-Object {
$password = ConvertTo-SecureString $_.pass -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "$_.name+$_.user",$password
Invoke-Command -ComputerName $_.name -Credential $credential -ScriptBlock {Get-Culture}
}
是否在目标计算机上启用了ps远程处理? 'enable-remoting' – Moerwald
这是,第一行“winrm quickconfig”包括启用PSremoting,我也尝试过后,它没有工作,但没有骰子分开后启用它。 –