How to - Azure Automation - Runbook - Active Directory Powershell cmdlets ?

Brass Contributor

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.



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.

4 Replies

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.


Hi Dominic,

which version PS you have?

last version 5.1?



Yes, 5.1.  I also installed any modules the runbook will need on the Hybrid Worker.  

Hi @Travis Roberts  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?