Skip to main content

Connect-LXC1

This cmdlet creates a connection to the XClarity One portal by retrieving, storing, and managing the token for a specific API client.

Note
You cannot pipe objects to this cmdlet.

Syntax

Connect-LXC1  -Credential PSCredential
-PortalAddress String
-PortalType String
[-Port Int32]
[-ProxyAddress String]
[-ProxyCredential PSCredential]
[-ProxyUseDefaultCredentials]
[-Timeout Int32]
[-SkipCertificateCheck]
[CommonParameter]
Parameters
-Credential PSCredential
Specifies a credential object that includes the ClientID and secret for authenticating to the XClarity One portal
Tip
You can use the Get-Credential cmdlet to obtain the credential object.
-PortalAddress String
Specifies the IP address or hostname for XClarity One portal in the cloud or the FQDN of the XClarity One portal hosted on premises.
-PortalType String
Specifies the XClarity One portal type. You can specify one of the following types.
  • cloud: XClarity One portal is hosted in the portal

  • onPremises: XClarity One portal is hosted on premises.

-Port Int32
Specifies the port to use to connect to the XClarity One portal. The default value is 443.
-ProxyAddress String
Specifies the IP address or hostname of a network proxy server of the proxy server to use instead of connecting directly to the internet.
-ProxyCredential PSCredential
Specifies a credential object for a user account that has permission to use the proxy server that is specified by the -ProxyAddress parameter.

This parameter is valid only when the -ProxyAddress parameter is specified.

You cannot use the -ProxyCredential and -ProxyUseDefaultCredentials parameters in the same command.

Tip
You can use the Get-Credential cmdlet to obtain the credential object.
-ProxyUseDefaultCredentials
Indicates that the cmdlet uses the credentials for the current user to access the proxy server that is specified by the -ProxyAddress parameter.

This parameter is valid only when the -ProxyAddress parameter is specified.

You cannot use the -ProxyCredential and -ProxyUseDefaultCredentials parameters in the same command.

-Timeout Int32
Specifies the number of seconds that the cmdlet waits for an HTTPS response from the XClarity One portal. By default, the time-out value is 3600 seconds.
-SkipCertificateCheck
If specified, this cmdlet does not check for server certificates. Otherwise, the connection is made only if the XClarity One portal contains a valid certificate that is signed by a trusted certification authority.
CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

  • Lenovo.XC1P.PowerShell.Automation.DataTypes.LXC1Connection

    If a connections was successfully created, this cmdlet returns an LXC1Connection object that contains information about the XClarity One portal connection.

  • System.String

    If a connection to the XClarity One portal cannot be created, this cmdlet returns a string object that contains information about the connection failure.

Examples

This cmdlet connects to an XClarity One portal using the Get-Credentials cmdlet. When you run the script, you are prompted to provide the clientID (UserName) and client secret (Password).
$hostOnprem = "192.0.2.0"

$cred = Get-Credential
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck
This cmdlet connects to an XClarity One portal using the New-Object cmdlet without being prompted for the clientID and secret.
param ( 
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)

$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword))
$hostOnprem = "192.0.2.0"

$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck