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:
Get-AzAutomationAccount
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten