Используя 2 машины, локальную и удаленную (с адресом, помеченным как remoteAddress
), я пытаюсь запустить это на локальном компьютере:
Invoke-Command -ComputerName remoteAddress -ScriptBlock { dir c:\ }
но я получаю эту ошибку:
[remoteAddress] Connecting to remote server remoteAddress failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (remoteAddress:String) [], PSRemotingTransportException + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken
Я следил за исправлениями в похожих ситуациях. Что я проверил:
Пинг на удаленный адрес прошел успешно.
На обеих машинах
Enable-PSRemoting -Force
вернулиWinRM is already set up to receive requests on this computer. WinRM is already set up for remote management on this computer.
на обеих машинах
Set-WSManQuickConfig
вернулиWinRM is already set up to receive requests on this computer. WinRM is already set up for remote management on this computer.
Но все же я получаю эту ошибку, пытаясь подключиться к удаленному компьютеру.
Я запустил test-wsman -ComputerName _remote-machine_ -Port 5985
со своей локальной машины и получил эту ошибку:
test-wsman : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. At line:1 char:1 + test-wsman -ComputerName _remote_ -Port 5985 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (_remote-machine_:String) [Test-WSMan], InvalidOperationExcept ion + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand
Get-Help about_Remote_Troubleshooting
. Вы следовали инструкциям, данным там? - person Ansgar Wiechers   schedule 20.11.2016winrm get winrm/config
на обоих хостах. - person Ansgar Wiechers   schedule 21.11.2016