0
votes

When running below workflow in ISE on my Azure Automation Hybrid Runbook Worker it works just fine. When executing the same workflow through Azure Automation I get:

Connecting to remote server servername failed with the following error message : Access is denied.

I also tried to execute the Runbook using runas with the same account I used logging into the Hybrid Runbook Worker to run the workflow in ISE. The target server and the Hybrid Runbook Worker are both domain joined, although in different domains.

Could it be that executing the workflow through Azure Automation introduces another hop and I run into a multi-hop issue?

workflow Temp
{
    $User = 'domain\username'
    $Password = ConvertTo-SecureString 'password' -AsPlainText -Force
    $Credentials = New-Object System.Management.Automation.PSCredential ($User, $Password)

     hostname
     [Environment]::UserName

    InlineScript
    {
        hostname
        [Environment]::UserName

    }  -PSCredential $Credentials -PSComputerName servername
}
1

1 Answers

0
votes

Executing the workflow on Azure Automation Hybrid Worker does not introduce any other hop. Are you sure that you were running the job on the Hybrid Worker and not in the cloud ?

This is likely a authentication issue as indicated by the message too. Are you running ISE as Admin ? Can you try to use the RunAs account as the same account that you are trying to connect to and see if that works.

Also can you try running this in a PowerShell script and not Workflow and see if that works.