Connect-LXC1
This cmdlet creates a connection to the XClarity One portal that can be used by other cmdlets.
Syntax
Connect-LXC1 -Credential PSCredential
-PortalAddress String
-PortalType String
[-PortalCertificateFile String]
[-Port Int32]
[-ProxyAddress String]
[-ProxyCredential PSCredential]
[-ProxyUseDefaultCredentials]
[-Timeout Int32]
[-SkipCertificateCheck]
[-WhatIf]
[-Confirm]
[CommonParameter]
- -Credential PSCredential
- Specifies a credential object that includes the ClientID and secret for authenticating to the XClarity One portalTipYou 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.
- -PortalCertificateFile String
- Specifies the full path of a PEM-encoded file that contains the server certificate chain (server's certificate, intermediate certificates (if available), and root CA chain certificates).
When specified, this cmdlet reads the file, parses all certificates it contains, and uses them to validate the portal's TLS certificate instead of relying solely on the system certificate store.
If the root CA certificate found in the file is not present in the system trust store, this cmdlet displays a browser-style trust warning and prompts you to confirm whether you trust the certificate before proceeding.
NoteYou cannot use the-SkipCertificateCheck and -PortalCertificateFile parameters in the same command. - -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
- Uses 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.
TipYou can use theGet-Credential cmdlet to obtain the credential object. - -ProxyUseDefaultCredentials
- 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
- Skips the portal's certificate validation checks, including expiration, revocation, and trusted root authority. Otherwise, the connection is made only if the XClarity One portal contains a valid certificate that is signed by a trusted certification authority.NoteYou cannot use the
-SkipCertificateCheck and -PortalCertificateFile parameters in the same command. WarningBe aware that using this parameteris not recommended. It is intended to be used only against known hosts using a self-signed certificate for testing purposes only. - -WhatIf
- Shows what would happen if the cmdlet runs. The cmdlet is not executed.
- -Confirm
- Prompts you for confirmation before running the cmdlet.
- 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
$hostCloud = "xclarityone.lenovo.com"
$cred = Get-Credential
$connection = Connect-LXC1 -PortalAddress $hostCloud`
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck
$hostOnprem = "192.0.2.0"
$certFile = "C:\certs\my-portal-chain.pem"
$cred = Get-Credential
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType onPremises `
-PortalCertificateFile $certFile