Getting Started with vRealize Operations Manager cmdlets
Provides cmdlets for automating vRealize Operations Manager features.
Step 1: Connect to Environment
To setup a connection you should use the Connect-OMServer command. Run the code sample below to connect.
Connect-OMServer -Server 'server_name' -User 'user_name' -Password 'user_password'
Connect-OMServer -Server 'server_name' -AuthSource 'vCenterServer_name_in_vROps' -User 'vCenterServer_admin' -Password 'user_password'
$srv = Connect-OMServer 'server_name' -User 'admin' -Password 'user_password'
Connect-OMServer 'server_name' -Session $srv.SessionId
$secpasswd = ConvertTo-SecureString 'PlainTextPassword' -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ('user_name', $secpasswd)
Connect-OMServer 'server_name' -Credential $mycreds
Step 2: Try a GET Command
For example when successfully connected you can run the Get-OMAlert command.
$resource = Get-OMResource -Name 'MyResource'
Get-OMAlert -Resource $resource -Status Active