Powershell:无法通过 SSL 连接

Powershell:无法通过 SSL 连接

正在按照“powershell 远程处理的秘密”设置 SLL 帐户,但似乎缺少了一个步骤。

我跑了

Winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname="redacted";CertificateThumbprint="redacted"}

并得到

PS WSMan:\localhost> dir wsman:\localhost\listener\Listener_1184937132


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Listener\Listener_1184937132

Name                      Value                                                             Type
----                      -----                                                             ----
Address                   *                                                                 System.String
Transport                 HTTP                                                              System.String
Port                      5985                                                              System.String
Hostname                                                                                    System.String
Enabled                   true                                                              System.String
URLPrefix                 wsman                                                             System.String
CertificateThumbprint                                                                       System.String
ListeningOn_756355952     10.0.0.54                                                         System.String
ListeningOn_1201550598    127.0.0.1                                                         System.String


PS WSMan:\localhost> dir wsman:\localhost\listener\Listener_1187163138


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Listener\Listener_1187163138

Name                      Value                                                             Type
----                      -----                                                             ----
Address                   *                                                                 System.String
Transport                 HTTP                                                              System.String
Port                      80                                                                System.String
Hostname                                                                                    System.String
Enabled                   true                                                              System.String
URLPrefix                 wsman                                                             System.String
CertificateThumbprint                                                                       System.String
ListeningOn_756355952     10.0.0.54                                                         System.String
ListeningOn_1201550598    127.0.0.1                                                         System.String


PS WSMan:\localhost> dir wsman:\localhost\listener\Listener_220862350


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Listener\Listener_220862350

Name                      Value                                                             Type
----                      -----                                                             ----
Address                   *                                                                 System.String
Transport                 HTTPS                                                             System.String
Port                      5986                                                              System.String
Hostname                  redacted                                                      System.String
Enabled                   true                                                              System.String
URLPrefix                 wsman                                                             System.String
CertificateThumbprint     redacted                          System.String
ListeningOn_756355952     10.0.0.54                                                         System.String
ListeningOn_1201550598    127.0.0.1                                                         System.String

问题是当我这样做的时候

PS C:\Users\redacted> enter-pssession -Computername redacted -Credential redacted\redacted -UseSSL

我明白了

Enter-PSSession : Connecting to remote server failed with the following error message : The client cannot connect to th
e destination specified in the request. Verify that the service on the destination is running and is accepting requests
. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or Win
RM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the
WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:16
+ enter-pssession <<<<  -Computername redacted -Credential redacted\redacted -UseSSL
    + CategoryInfo          : InvalidArgument: (redacted:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

即使防火墙完全关闭并且机器尝试本地连接自身,也会发生这种情况。

最重要的是,尽管听众在 wsman 上列出,但当我运行

PS WSMan:\localhost&gt; Get-PSSessionConfiguration

我明白了

Name                      PSVersion  StartupScript        Permission
----                      ---------  -------------        ----------
Microsoft.PowerShell      2.0


PS WSMan:\localhost&gt;

知道我遗漏了什么或者做错了什么吗?

编辑:Windows 2003.Powershell v2.0

相关内容