1,进入cmd,输入winrm quickconfig -q,如果出现下图报错,把电脑公网设置为专网
设置专网步骤:win+i,网络和internet,状态,属性
2,检查 winrm 服务监听状态;进入cmd,输入winrm e winrm/config/listener;记录端口号 Port 值,后面会用到
3,查看 winrm 配置信息(可选)
通过以下命令可以查看 winrm 全部配置信息、client 客户端配置信息、service 服务端配置信息
# 全部
winrm get winrm/config
# Client
winrm get winrm/config/client
# Service
winrm get winrm/config/service
4,配置 winrm client
# 配置winrm client
winrm set winrm/config/client @{AllowUnencrypted="true"}
winrm set winrm/config/client @{TrustedHosts="*"}
winrm set winrm/config/client/auth @{Basic="true"}
5,配置 winrm service
在配置完 winrm service 和 winrm client 后,我们通过通过步骤 3 查看配置文件,确保配置文件已生效
# 配置winrm service
winrm set winrm/config/service @{AllowUnencrypted="true"}
winrm set winrm/config/service/auth @{Basic="true"}
6,进入cmd安装pywinrm依赖包
标签:set,service,python,配置,winrm,windows,client,config,远程 From: https://www.cnblogs.com/liuweipaul123/p/17297671.html