Can not Stop-Computer in powershell 6.0

1

PS C:\Program Files\PowerShell\6.0.0-beta.6> Stop-Computer
Stop-Computer : Failed to stop the computer WASYGSHA01-1020 with the following error message: The client cannot connect
to the destination specified in the request. Verify that the service on the destination is running and is accepting re
quests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS
or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configur
e the WinRM service: "winrm quickconfig"..
At line:1 char:1
+ Stop-Computer
+ ~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (WASYGSHA01-1020:String) [Stop-Computer], InvalidOperationException
+ FullyQualifiedErrorId : StopComputerException,Microsoft.PowerShell.Commands.StopComputerCommand

 

 2

PS C:\Program Files\PowerShell\6.0.0-beta.6> get-service winrm

Status Name DisplayName
------ ---- -----------
Stopped WinRM Windows Remote Management (WS-Manag...

 

2.1 Start-Service winrm

 

 

 

 3 winrm quickconfig(first time)

PS C:\Program Files\PowerShell\6.0.0-beta.6> winrm quickconfig
WinRM is not set up to receive requests on this machine.
The following changes must be made:

Start the WinRM service.
Set the WinRM service type to delayed auto start.

Make these changes [y/n]? y

WinRM has been updated to receive requests.

WinRM service type changed successfully.
WinRM service started.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:

Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
Enable the WinRM firewall exception.

 

4 winrm quickconfig(second time)

PS C:\Program Files\PowerShell\6.0.0-beta.6> winrm quickconfig
WinRM service is already running on this machine.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:

Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
Enable the WinRM firewall exception.

Make these changes [y/n]? y

WinRM has been updated for remote management.

Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
WinRM firewall exception enabled.

 

5   verify it

PS C:\Program Files\PowerShell\6.0.0-beta.6> winrm e winrm/config/listener
Listener
Address = *
Transport = HTTP
Port = 5985
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn = 127.0.0.1, 169.254.76.188, 169.254.141.162, 169.254.187.252, 172.31.212.20, ::1, fe80::5efe:172.31.212.20%6, fe80::4841:a122:e4e4:bbfc%11, fe80::51ba:2dc7:d1bf:8da2%3, fe80::543f:76ba:7341:4cbc%2, fe80::8557:8e2d:f82d:ab5a%10

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(740)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2016-09-07 nuget.exe the application could not be started
2016-09-07 choco命令
2016-09-07 How do I reset Windows Update components?
2015-09-07 How to convert an IPv4 address into a integer in C#?
2015-09-07 System.Windows.Forms中的Message Structure
2015-09-07 What exactly is the difference between WndProc and DefaultWndProc?
点击右上角即可分享
微信分享提示