无法将二进制文件复制到远程Azure VM [英] Unable to copy a binary to a remote Azure VM

查看:92
本文介绍了无法将二进制文件复制到远程Azure VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自本地(VMWare)的Shavlink代理二进制文件,必须将其复制到Azure VM.

I have a Shavlink agent binary from on-prem(VMWare) that has to be copied across to a Azure VM(s).

我使用目标Azure VM的公共VM执行复制:

I used the public VM of the target Azure VM to perform the copy:

Copy-Item –Path "C:\ProgramData\LANDESK\Shavlik Protect\Console\DataFiles\STPlatformUpdater.exe" –Destination "D:\Shavlik-Agent\" –ToSession (New-PSSession –ComputerName a.b.c.d)

不幸的是,它给出如下错误:

Unfortunately, it gives error as below:

New-PSSession : [a.b.c.d] Connecting to remote server a.b.c.d. failed with the following error message : The WinRM client cannot process the request. Default
authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit
credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to
set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:143
+ ... avlik-Agent\" –ToSession (New-PSSession –ComputerName a.b.c.d.)
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CannotUseIPAddress,PSSessionOpenFailed
Copy-Item : Cannot validate argument on parameter 'ToSession'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again
At line:1 char:142
+ ... avlik-Agent\" –ToSession (New-PSSession –ComputerName a.b.c.d+                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-Item], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.CopyItemCommand

在远程计算机上,我启用了端口 5985 5986 ,想知道要使其正常工作需要做什么?

On remote machine, I have enabled ports 5985 and 5986 wondering what I need to do to make it working?

推荐答案

您需要将Winrm配置为信任远程计算机,最简单的方法如下:

you need to configure your winrm to trust the remote machine, easiest way of doing this is the following:

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "a.b.c.d"

阅读: https://docs.microsoft.com/zh-cn/windows/win32/winrm/installation-and-configuration-for-windows-remote-management

这篇关于无法将二进制文件复制到远程Azure VM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆