Connect-SrmServer

This cmdlet establishes a connection to an SRM server. To access the SRM API, use the ExtensionData property of the output of this command.The resulting connections are added to the list of default connections in a global variable named "$global:DefaultSrmServers" (if the NotDefault switch was not specified).If you are already connected to a vCenter Server system, you can connect to its corresponding SRM server by passing that connection to the Server parameter (see Example 1). If you call Connect-SrmServer and do not specify which server to connect to, the cmdlet uses the default vSphere connections.To connect to an SRM server without connecting its corresponding vCenter Server first, use the SrmServerAddress parameter.An SRM deployment typically consists of two sites - a protected site and protecting site. Certain operations require that the session is logged to both sites. To create such a session, specify the RemoteCredential parameter. Some operations are valid for execution only at a protected or protecting site. For those cases, establish the session to that site by specifying the SRM server address at that site to the SrmServerAddress parameter or passing a connection to the vSphere server at that site to the Server parameter.For more information about SRM API operations, see the SRM API reference guide installed with PowerCLI.

Syntax

[-Credential  <PSCredential>]
[-IgnoreCertificateErrors]
[-NotDefault]
[-Password  <SecureString>]
[-Port  <Int32>]
[-Protocol  <String>]
[-RemoteCredential  <PSCredential>]
[-RemotePassword  <SecureString>]
[-RemoteUser  <String>]
[-Server  <VIServer[]>]
[-User  <String>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
Credential
PSCredential named Specifies the credentials to be used to log in to the SRM server. This parameter is an alternative to the user/password pair of parameters.
optional
IgnoreCertificateErrors
SwitchParameter named If specified, any errors related to a bad server certificate of the SRM server are ignored.
optional
NotDefault
SwitchParameter named If specified, the resulting connection is not listed in the list of default connections to SRM servers and must be manually specified when used with a cmdlet.
optional
Password
SecureString named Specifies the password for the connection to the SRM server.
optional
Port
Int32 named Specifies the port on the server you want to use for the connection. If not specified, a protocol-specific default value is used.
optional
Protocol
String named Specifies the Internet protocol you want to use for the connection. It can be either HTTP or HTTPS. If not specified, HTTPS is used.
optional
RemoteCredential
PSCredential named Specifies the credentials for a remote SRM server.
optional
RemotePassword
SecureString named Specifies the password for the connection to the remote SRM server.
optional
RemoteUser
String named Specifies the user name that is used to log on in to the remote SRM server.
optional
Server
VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server system that the SRM server is associated to. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
    optional
    User
    String named Specifies the user name that is used to log in to the SRM server.

    -SrmServerAddress  <String>
    [-Credential  <PSCredential>]
    [-IgnoreCertificateErrors]
    [-Locale  <String>]
    [-NotDefault]
    [-Password  <SecureString>]
    [-Port  <Int32>]
    [-Protocol  <String>]
    [-RemoteCredential  <PSCredential>]
    [-RemotePassword  <SecureString>]
    [-RemoteUser  <String>]
    [-User  <String>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    SrmServerAddress
    String named Specifies the IP address or fully qualified domain name (FQDN) of the SRM server.
    optional
    Credential
    PSCredential named Specifies the credentials to be used to log in to the SRM server. This parameter is an alternative to the user/password pair of parameters.
    optional
    IgnoreCertificateErrors
    SwitchParameter named If specified, any errors related to a bad server certificate of the SRM server are ignored.
    optional
    Locale
    String named If specified, defines the locale of the strings produced by the server for this connection.
    optional
    NotDefault
    SwitchParameter named If specified, the resulting connection is not listed in the list of default connections to SRM servers and must be manually specified when used with a cmdlet.
    optional
    Password
    SecureString named Specifies the password for the connection to the SRM server.
    optional
    Port
    Int32 named Specifies the port on the server you want to use for the connection. If not specified, a protocol-specific default value is used.
    optional
    Protocol
    String named Specifies the Internet protocol you want to use for the connection. It can be either HTTP or HTTPS. If not specified, HTTPS is used.
    optional
    RemoteCredential
    PSCredential named Specifies the credentials for a remote SRM server.
    optional
    RemotePassword
    SecureString named Specifies the password for the connection to the remote SRM server.
    optional
    RemoteUser
    String named Specifies the user name that is used to log on in to the remote SRM server.
    optional
    User
    String named Specifies the user name that is used to log in to the SRM server.

    Output

    VMware.VimAutomation.Srm.Types.V1.SrmServer

    Examples


    Example 1

    Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
    Connect-SrmServer

    Connects to a vCenter Server system, that has an SRM server associated with it. Then, invokes the cmdlet without specifying any parameters to establish a connection to the SRM server registered with the connected vCenter Server system. If you have previously connected to other vCenter Server systems configured with SRM server support, this cmdlet invocation will establish a connection to their corresponding SRM servers as well.

    Example 2

    Connect-SrmServer -SrmServerAddress 192.0.2.1 -User "myUser" -Password "myPassword"

    Connects to an SRM server with an IP address of 192.0.2.1 by passing a valid user name and password.

    Example 3

    Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
    Connect-SrmServer -RemoteCredential $myRemoteCredential

    Connects to a vCenter Server system associated with an SRM server. Then, establishes a connection to that SRM server by passing valid credentials for connection to the remote SRM server.

    Example 4

    Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
    Connect-SrmServer -NotDefault -IgnoreCertificateErrors

    Connects to a vCenter Server system, that has an associated SRM server. Then, establishes an SRM server connection by ignoring any errors related to bad server certificates. The newly created SRM server connection is not added to the default list of SRM server connections.

    Related Commands

    Feedback

    Was this page helpful?