Skip to content

Latest commit

 

History

History
39 lines (35 loc) · 1.6 KB

2-Inventory-Management.md

File metadata and controls

39 lines (35 loc) · 1.6 KB

Inventory Management

Instructions: Azure Arc-enabled servers inventory management using Resource Graph Explorer

List all hybrid machines:

Resources
| where type =~ 'Microsoft.HybridCompute/machines'

Check for resources that have a value for the Scenario tag:

Resources
| where type =~ 'Microsoft.HybridCompute/machines' and isnotempty(tags['Scenario'])
| extend Scenario = tags['Scenario']
| project name, tags

List extensions installed on our Azure Arc-enabled servers:

Resources
| where type == 'microsoft.hybridcompute/machines'
| project id, JoinID = toupper(id), ComputerName = tostring(properties.osProfile.computerName), OSName = tostring(properties.osName)
| join kind=leftouter(
    Resources
    | where type == 'microsoft.hybridcompute/machines/extensions'
    | project MachineId = toupper(substring(id, 0, indexof(id, '/extensions'))), ExtensionName = name
) on $left.JoinID == $right.MachineId
| summarize Extensions = make_list(ExtensionName) by id, ComputerName, OSName
| order by tolower(OSName) desc

List the Azure Arc Agent version installed on your Azure Arc-enabled servers:

Resources
| where type =~ 'Microsoft.HybridCompute/machines'
| extend arcAgentVersion = tostring(properties.['agentVersion']), osName = tostring(properties.['osName']), osVersion = tostring(properties.['osVersion']), osSku = tostring(properties.['osSku']),
lastStatusChange = tostring(properties.['lastStatusChange'])
| project name, arcAgentVersion, osName, osVersion, osSku, lastStatusChange