How can I run a powershell script on an entire Azure management group to span multiple subscriptions?

148 Views Asked by At

How can I run a powershell script on an entire Azure management group to span multiple subscriptions? I need to export resource inventories from multiple subscriptions with a single run in the same file.

1

There are 1 best solutions below

0
Ken W - Zero Networks On

You will need to use Azure Resource Graph which supports PowerShell, CLI and Azure SDK for .NET.

Search-AzGraph -Query "Resources | summarize count()"

https://learn.microsoft.com/en-us/azure/governance/resource-graph/first-query-powershell

https://learn.microsoft.com/en-us/azure/governance/resource-graph/samples/starter?tabs=azure-powershell#count-resources