1
votes

I was working with azure runbooks in automation accounts for quite a while but recently I was tasked to identify who was executing the runbook.

I noticed that there is a fied called "Executed by" when you get information from a job, but seems that field is being removed by MSFT.

Checking the logs I can see the calls to the runbook but the job id stated in the log doesn't match the one in the jobid in the runbook inside the automation account.

I was wondering how can I match an execution on a runbook with a entry in the log.

any idea with powershell or by calling the REST API directly?

Thanks!

1

1 Answers

0
votes

You can get the user who started the Automation job using the startedBy field returned in the Get-AzureRmAutomationJob and REST API.

This will require passing in the job id, which you can get using: $PsPrivateMetadata.JobId.Guid