KB修补程序安装在多台服务器上

时间:2018-06-26 04:21:48

标签: windows powershell

我正在尝试在多台服务器上安装KB补丁,但是执行时出现以下错误消息。有人可以帮我吗?

仅供参考:系统上已启用PSRemoting

代码:

$SB={ Start-Process -FilePath 'wusa.exe' -ArgumentList "C:\Program Files (x86)\McAfee\Win7AndW2K8R2-KB3134760-x64.msu /quiet /norestart" -Wait -PassThru }


Invoke-Command -ComputerName computer -ScriptBlock $SB

错误:

[computer] Connecting to remote server computer failed with the following error message : WinRM cannot process the
request. The following error occurred while using Kerberos authentication: Cannot find the computer computer. Verify
that the computer exists on the network and that the name provided is spelled correctly. For more information, see the
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (computer:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : NetworkPathNotFound,PSSessionStateBroken
[computer] Connecting to remote server computer failed with the following error message : WinRM cannot process the
request. The following error occurred while using Kerberos authentication: Cannot find the computer computer. Verify
that the computer exists on the network and that the name provided is spelled correctly. For more information, see the
about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (computer:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : NetworkPathNotFound,PSSessionStateBroken

1 个答案:

答案 0 :(得分:0)

如果您正确的话,您似乎正在尝试在工作组计算机上运行脚本,当您在工作组计算机上运行脚本时,必须在运行脚本之前在每台服务器上设置以下命令

Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
Restart-Service WinRM
Test-WsMan <server name>