Forum Discussion
How to - Azure Automation - Runbook - Active Directory Powershell cmdlets ?
How do run the Get-ADUser Active Directory powershell cmdlet within an Azure automation runbook ?
Not all our AD objects are synced to Azure AD and there is a requirement to query on-premise AD from an Azure automation runbook.
Error:
The term 'Get-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct
and try again.
- TravisRobertsIron Contributor
Take a look at Azure Automation Hybrid Workers to run the runbook in your domain. I did a video on setting one up located here. http://www.ciraltos.com/azure-automation-hybrid-worker-setup-and-runas-account/
- MamatiyeCopper Contributor
Hi TravisRoberts I hope you are well.
The point is I'm trying to get the list of accounts that have expired in my Active directory from runbbok, but this one doesn't work. I have followed all your steps in the video and I can't get it. Could you help me?
- Fabrizio GiovannettiMicrosoft
Hi Dominic,
which version PS you have?
last version 5.1?
Cheers
Fabrizio
- TravisRobertsIron Contributor
Yes, 5.1. I also installed any modules the runbook will need on the Hybrid Worker.