如何通过PowerShell在Azure虚拟机上远程运行Puppet bolt命令 [英] How to run puppet bolt command remotely on Azure Virtual Machine through powershell

查看:125
本文介绍了如何通过PowerShell在Azure虚拟机上远程运行Puppet bolt命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过powershell通过puppet bolt command在远程Azure VM下运行.

I'm trying to run below puppet bolt command for remote Azure VM through powershell.

bolt command run ipconfig --targets winrm://158.28.0.546 --no-ssl -user testuser123 -password test@84p

在Powershell中获取上述命令的以下错误

getting below error for above command in powershell

在192.168.0.140上失败:

Failed on 192.168.0.140:

连接到192.168.0.140的10秒后超时

Timeout after 10 seconds connecting to 192.168.0.140

在1个目标上失败:192.168.0.140

Failed on 1 target: 192.168.0.140

如何解决以上问题

更新1:

WinRM.对于公共网络,甚至在Azure VM上也禁用了Firewall.

WinRM enabled on remote Azure Virtual Machine. Even Firewall is disabled on Azure VM for public networks.

Azure Portal中添加DNS name后,出现如下错误

After adding DNS name in Azure Portal, I'm getting error as below

无法连接到 https://testazurevm.westus.cloudapp.azure.com:5986/wsman:

Failed to connect to https://testazurevm.westus.cloudapp.azure.com:5986/wsman:

由于目标机器被主动拒绝,因此无法建立连接 它

No connection could be made because target machine actively refused it

推荐答案

对于此问题,尝试连接后错误显示超时.通常,这是因为端口不允许您连接.据我所知,应该有两个原因.一是防火墙不允许从端口访问.另一个是不监听该端口.

For this issue, the error shows a timeout after trying to connect. Generally, it is because the port does not allow you to connect. And there should be two reasons as I know. One is that the firewall does not allow access from the port. Another is that the port does not be listened to.

对于您来说,您可以检查防火墙是否允许WinRM端口,以及是否在VM中启用了WinRM.

For you, you can check if the firewall allows the WinRM port and if the WinRM is enabled in the VM.

这篇关于如何通过PowerShell在Azure虚拟机上远程运行Puppet bolt命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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