We are running our PowerShell Script in Remote Windows Server 2019. We use Connect-AzureAD and Connect-IPPSsesion. The script took about 3 hours to complete the whole process. It was working fine a few weeks ago but we're getting this error the past few day for some reason.
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.
It able to connected when the script start but we got that error during the process and stop the script.
I've been google the past few days and I found this documentation
I've tried the following
- I've try to do the solutions that it provided in doc but there is no IIS and MSExchangePowerShellAppPool in our Remote Desktop.
- I checked the User and it has the remotepowershell enabled (Always has been)
- I checked WinRM QuickConfig and it set up properly
- I change our proxy address to a different proxy address
but still no luck so any suggestion or help would be really appreciated.
By default, MSExchangePowerShellAppPool without running this application it is complex to find a solution. If you don't have MS Exchange PowerShell in your Desktop, please try the below.
Try using below cmdlet with Windows PowerShell
Reference: Connect to a remote Exchange server
Alternatively, you can use EMTshooter The local (target) Exchange server's EMTshooter programme runs there and looks for any issues that might affect the management tools attached to it.
C:\Windows\system32\iis_ssi.dllexists.