Hello,
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.
Regards
Shahab
Hello,
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.
Regards
Shahab
Hi @Jafarishahab-1084 ,
did the answer work for you? Are there any additional questions to this topic?
If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A
Regards
Andreas Baumgarten
Hi @Jafarishahab-1084 ,
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
8 people are following this question.