Created
March 25, 2020 20:49
-
-
Save taddison/1a4979186707dc6c2e2b7e433736c7c7 to your computer and use it in GitHub Desktop.
DumpAllWindowsPerformanceCounters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect-AzAccount | |
$allPerfCounters = @() | |
$subscriptions = Get-AzSubscription | |
foreach ($subscription in $subscriptions) { | |
$subscription | Set-AzContext | |
$workspaces = Get-AzOperationalInsightsWorkspace | |
foreach ($workspace in $workspaces) { | |
$perfCounters = Get-AzOperationalInsightsDataSource -Kind WindowsPerformanceCounter -Workspace $workspace | |
foreach ($counter in $perfCounters) { | |
$allPerfCounters += [pscustomobject]@{ | |
Subscription = $subscription.Name | |
ResourceGroup = $counter.ResourceGroupName | |
Workspace = $counter.WorkspaceName | |
ObjectName = $counter.Properties.ObjectName | |
InstanceName = $counter.Properties.InstanceName | |
CounterName = $counter.Properties.CounterName | |
Interval = $counter.Properties.IntervalSeconds | |
} | |
} | |
} | |
} | |
$allPerfCounters | ft |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment