PowerCLI Reference

Connect-OMServer

Synopsis

This cmdlet establishes a connection to the specified vRealize Operations Manager server.

Syntax

Connect-OMServer [-Server] <String[]> [-User <String>] [-Password <SecureString>] [-AuthSource <String>] [-Port <Int32>] [-NotDefault] [-Force] [-SaveCredentials] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Connect-OMServer [-Server] <String[]> [-Port <Int32>] [-NotDefault] [-Force] -SessionSecret <String> [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Connect-OMServer [-Server] <String[]> [-AuthSource <String>] [-Port <Int32>] -Credential <PSCredential> [-NotDefault] [-Force] [-SaveCredentials] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Connect-OMServer -Menu [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Related Commands

Online version
Disconnect-OMServer

Detailed Description

This cmdlet establishes a connection to the vRealize Operations Manager server specified by the -Server parameter.

The connect and disconnect operations for a server are using a reference counting mechanism. Every server is identified by its connection string which contains server, user name, and authentication source. If there is already an existing connection to the server, a new connection is not established. Instead, the cmdlet returns the object which represents the existing connection. The RefCount property of the object is incremented by one. Note that a new object is not created. Therefore, the RefCount of the previously returned object will be updated as well. When a server is disconnected, then its RefCount property is decreased by one. If this number becomes equal to zero, then the server is disconnected.

PowerCLI supports a list of default vRealize Operations Manager servers. When an operation is performed, if the target servers cannot be determined from the specified parameters, the cmdlet runs against the servers in the default server list. They are kept in a global variable called $DefaultOMServers. It is of an array type and its initial value is an empty array. When you connect to a server, the server is added at the beginning of the array, unless -NotDefault parameter is specified. When you disconnect from a server, the server is removed from the $DefaultOMServers variable. When all servers are removed from the variable, its value is an empty array. You can modify the value of the $DefaultOMServers variable manually.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerString[]Specifies the IP or DNS addresses of the vRealize Operations Manager servers you want to connect to.truefalse
AuthSourceStringSpecifies the authentication source type. The default authentication source type value is LocalUser. You can specify ActiveDirectory, OpenLDAP, or VC as authentication source type values.falsefalse
CredentialPSCredentialSpecifies a PSCredential object that contains credentials for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".truetrue (ByValue)
ForceSwitchParameterSuppresses all user interface prompts during the cmdlet execution.falsefalse
InformationActionActionPreferencefalsefalse
InformationVariableStringfalsefalse
MenuSwitchParameterIndicates that you want to select a connection server from a list of recently connected servers. If Menu is provided, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list.truefalse
NotDefaultSwitchParameterSpecifies that you do not want to save the specified servers as default servers.falsefalse
PasswordSecureStringSpecifies the password you want to use for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".
Note: If the password contains special characters, enclose the entire string in single quotes (').
falsefalse
PipelineVariableStringfalsefalse
PortInt32Specifies the port on the server you want to use for the connection. If not specified, the default port value is 443.falsefalse
SaveCredentialsSwitchParameterIndicates that you want to save the specified credentials in the local credential store.falsefalse
SessionSecretStringSpecifies the ID of an existing vRealize Operations Manager session you want to reestablish.truefalse
UserStringSpecifies the user name you want to use for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".
Note: If the user name contains special characters, enclose the entire string in single quotes (').
falsefalse

Return Type

OMServer

Notes

Examples

-------------- Example 1 --------------

Connect-OMServer -Server 'server_name' -User 'user_name' -Password 'user_password'

Connects to a vRealize Operations Manager server by using the User and Password parameters.

-------------- Example 2 --------------

Connect-OMServer -Server 'server_name' ?AuthSource 'vCenterServer_name_in_vROps' -User 'vCenterServer_admin' -Password 'user_password'

Connects to a vRealize Operations Manager server as a vCenter Server user, imported from the monitored vCenter Server system.

-------------- Example 3 --------------

$srv = Connect-OMServer 'server_name' -User 'admin' -Password 'user_password'
 
Connect-OMServer 'server_name' -Session $srv.SessionId

Connects to a vRealize Operations Manager server with an existing session.

-------------- Example 4 --------------

$secpasswd = ConvertTo-SecureString 'PlainTextPassword' -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ('user_name', $secpasswd)

Connect-OMServer 'server_name' -Credential $mycreds

Connects to a vRealize Operations server by using a credentials object.


Copyright © VMware, Inc. All rights reserved.