bridrod
Contributor
Contributor

Finding a VM in vROPS and vCenter VM belongs to using Powershell

Hi,

I am trying to use PowerShell to pull some VM info from vRealize Operations Manager (vROPS). The idea is to search for a VM, and find out if the VM exists in any of our vCenters and display which one if found. Since vROPS is plugged with all the vCenters, I though leveraging that would be the way to go (instead of connecting to dozens of vCenters). So far I was able to do this:

$VM = "TESTVM"
Connect-OMServer VROPS_SERVERR -User USERNAME -Password PASSWORD
Get-OMResource -AdapterKind VMWARE -ResourceKind VirtualMachine | where { $_.Name -match $VM }

It finds the VM, but it does not provide the vCenter where the VM is registered under.

When I use the GUI, it shows me the vCenter too.

Any help is greatly appreciated!

Rod

0 Kudos
0 Replies