PowerShell远程连接到Windows

通过PowerShell远程连接到Windows

1、目标Windows配置

远程连接到目标Windows服务器,以管理员身份运行PowerShell,执行以下命令开启服务

Enable-PSRemoting

然后一路确定。_

开启服务后,设置谁可以通过PowerShell连接到本服务器,执行以下命令

我有几张阿里云幸运券分享给你,用券购买或者升级阿里云相应产品会有特惠惊喜哦!把想要买的产品的幸运券都领走吧!快下手,马上就要抢光了。

Set-Item wsman:\localhost\Client\Trustedhosts $ip

其中ip为本地的IP地址。如果你的IP地址不稳定,可执行

Set-Item wsman:\localhost\Client\Trustedhosts *

再执行以下命令

Test-WSMan $ip #本地或云服务器上
Test-WSMan localhost #云服务器上

_
这样就在云端设置成功了。

猜你喜欢

转载自my.oschina.net/u/3611008/blog/1621600