Resource objects are data centers, folders, clusters, ESXi hosts, datastores, virtual machines, resource pools, and so on. The Get-OMResource
cmdlet retrieves vRealize Operations Manager resource objects. The syntax of Get-OMResource
cmdlet is as follows. The first parameter set is the default:
Get-OMResource [[-Name] <String[]>] [-ResourceKind <String[]>]
[-AdapterKind <String[]>] [-Orphaned] [-Server <OMServer[]>]
[<CommonParameters>]
The second parameter set is there to retrieve vROPs resource objects by ID:
Get-OMResource -Id <String[]> [-Server <OMServer[]>]
[<CommonParameters>]
The -Id
parameter is required.
The third parameter set is required to retrieve vROPs resource objects by specifying objects from vSphere:
Get-OMResource [-Entity] <VIObjectCore[]> [<CommonParameters>]
The -Entity
parameter is required.
If you use the Get-OMResource
cmdlet without parameters, it will retrieve all of the vROPs objects. The list of objects is long. In the following example, we will pipe the output of the Get-OMResource
cmdlet to the Select-Object
cmdlet to retrieve only the first five objects:
PowerCLI C:> Get-OMResource | Select-Object -First 5
The output of the preceding command is as follows:
Name Health ResourceKind Description ---- ------ ------------ ----------- Cluster01 Green ClusterCompu... vApp01 Green ResourcePool vCenter Server 192.168.0.... Green PythonRemedi... vSphere World Green vSphere World Container Green ContainerAda...
18.224.95.38