SOLVED

VM Agent Status and Version Reporting

Occasional Contributor

Hello, I'm trying to see if there is anyway to pull information that is listed in the portal via PS/CLI/API/Graph across subscriptions.

 

I'm specifically looking for the current "Agent Status" and version seen here:

 

clipboard_image_0.png

 

From what I can find the information in the OSProfile property does not always exist depending on how the VM was deployed and even when it does, it only lists True, not the status or the version.

 

Thanks,

 

Nathan

 

1 Reply
best response confirmed by nathan_mitten_rpa (Occasional Contributor)
Solution

@nathan_mitten_rpa, when you query for an individual VM with the "Status" switch, you get the VM Agent details, as follows:

 

$vm = Get-AzVm -Name "vm name" -ResourceGroupName "RG name" -Status

$vm.VMAgent.VmAgentVersion

 

However, the VM must be running to get all the details.