Getting Started with vRealize Operations Manager cmdlets
Provides cmdlets for automating vRealize Operations Manager features.
Step 1: Connect to Environment
# Connects to a VMware Aria Operations server by using the User and Password parameters.
Connect-OMServer -Server 'server_name' -User 'user_name' -Password 'user_password'
You can also connect to remote environment by running one of the alternative options to connect below:
Option 1 :
# Connects to a VMware Aria Operations server as a vCenter Server user, imported from the monitored vCenter Server system.
Connect-OMServer -Server 'server_name' -AuthSource 'vCenterServer_name_in_vROps' -User 'vCenterServer_admin' -Password 'user_password'
Option 2 :
# Connects to a VMware Aria Operations server with an existing session.
$srv = Connect-OMServer 'server_name' -User 'admin' -Password 'user_password' Connect-OMServer 'server_name' -Session $srv.SessionId
Option 3 :
# Connects to a vRealize Operations server by using a credentials object.
$secpasswd = ConvertTo-SecureString 'PlainTextPassword' -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ('user_name', $secpasswd) Connect-OMServer 'server_name' -Credential $mycreds
Step 2: Retrieve a object by running a Get command
# Retrieves all active alerts for a given resource.
$resource = Get-OMResource -Name 'MyResource' Get-OMAlert -Resource $resource -Status Active