Getting all automainton account names of a tenant

Jafari, shahab 1 Reputation point

Is there any way that i could get all automation account names of our tenant by a script? I am a global admin of the tenant.


Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,142 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 98,621 Reputation points MVP

    Hi @Jafari, shahab ,

    this should be possible with this PowerShell command:

    Get-AzAutomationAccount -ResourceGroupName "xyz"  

    You need to have the AZ module installed.
    If you have automation accounts in different Resource Groups you might to get the Resource Groups first and use a for-each-Object around. This should look like this:

    Get-AzResourceGroup | ForEach-Object {  
      Get-AzAutomationAccount -ResourceGroupName $_.ResourceGroupName }  

    [Update 2/27/2022] I just learned it's even more simple, because Get-AzAutomationAccount doesn't require the Resource Group Name. Thanks to @tbgangav-MSFT

    Just run this and you get all Automation Accounts:



    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

    0 comments No comments