Azure Automation runbook was not working with remote PS

Manikanta Puppala 21 Reputation points

Dear Team,

Azure automation runbook was not working with remote PS, please find the below code for reference,

$Vm = "https://X.X.X.X:5986/WSMAN"
$so = New-PSSessionOption -SkipCACheck -SkipCNCheck
$rmSession = New-PSSession -ConnectionUri $Vm -SessionOption $so -CertificateThumbprint XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Error Message,

[X.X.X.X] Connecting to remote server X.X.X.X failed with the
| following error message : WinRM cannot complete the operation. Verify
| that the specified computer name is valid, that the computer is
| accessible over the network, and that a firewall exception for the WinRM
| service is enabled and allows access from this computer. By default, the
| WinRM firewall exception for public profiles limits access to remote
| computers within the same local subnet. For more information, see the
| about_Remote_Troubleshooting Help topic.

I have uploaded the required certificate under the automation account too, The same code was working from my local machine.

It would be great if any solution is provided here.

Note: This was not a Hybrid Runbook

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
994 questions
0 comments No comments
{count} votes

Accepted answer
  1. Maxim Sergeev 6,556 Reputation points Microsoft Employee

    Azure Automation Account Sandbox is a public-faced service. It's not configurable to work with custom certificates for authorization.

    Only for using the certificate for the runbook\script itself.

    If you need to authenticate your PS session, it requires to run your PS sessions on hybrid worker servers.

    0 comments No comments

0 additional answers

Sort by: Most helpful