HTTP is getting connected successfully, but getting error while connecting through HTTPS
The connection to the specified remote host was refused. Verify that the WS-Management service is running on the remote host and configured to listen for requests on the correct port and HTTP URL.
When we are trying to connect to virtual directory
$session = new-pssession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://oa.***Domain****.com/powershell" -AllowRedirection -SessionOption $sessionOption -Authentication Kerberos
getting the below error
new-pssession : [oa.domain.com] Connecting to remote server oa.domain.com failed with the following error
message : The connection to the specified remote host was refused. Verify that the WS-Management service is running on
the remote host and configured to listen for requests on the correct port and HTTP URL. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:12
- $session = new-pssession -ConfigurationName Microsoft.Exchange -Conne ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException - FullyQualifiedErrorId : CannotConnectWinRMService,PSSessionOpenFailed
Exchange | Exchange Server | Management
2 answers
Sort by: Most helpful
-
-
Aholic Liang-MSFT 13,886 Reputation points Microsoft External Staff
2022-04-21T07:15:21.337+00:00 Hi @Sayantan Raha ,
According to the official Microsoft documentation I have found a piece of information that may be of help to you . You may need to use http instead of https in the ConnectionUri value.
( https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps)
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.