Skip to main content

Get-LXCAQuantityLicense

This cmdlet retrieves all installed licenses or export a specified list of the installed licenses to the local system.

Note
You cannot pipe objects to this cmdlet.

Syntax

Add-LXCAQuantityLicense [-Connection LXCAConnection] 
[CommonParameter]

Add-LXCAQuantityLicense [-Connection LXCAConnection]
-LicenseIds String[]
[-Destination String]
[-Overwrite]
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
-Destination String
Specifies the directory and file name where the file is to be saved on the local system.
  • If you specify a directory but not a file name (in other words, if the string ends with a back slash \), the file name that is returned by the XClarity Administrator is used.

    If the directory does not exist, it is automatically created.

  • If you specify a string that does not end with a backslash \, the name after the last backslash \ is used as the file name.

    Note
    The cmdlet might modify the file extension to reflect the actual file type. The type depends on how many installed licenses can be exported.
    • If only one license can be exported, the exported file is the license key, and the file extension is key.

    • If multiple licenses can be exported, the exported file is an archive license keys, and the file extension is zip.

-LicenseIds String[]
Specifies a list of IDs of licenses to be exported, separated by a comma.
Note
The list is filtered to match the IDs of the installed licenses. Therefore:
  • Only founded licenses are exported.

  • If no license is found, the ERROR: Licenses with IDs <licenses_ids> are not installed on LXCA message is displayed.

-Overwrite
When specified, if the file already exists in the specified directory, the file is overwritten. The default value for Overwrite is false.

If not specified, and the file already exists in the specified directory, the file is not overwritten, and the System.IO.IOException: The _full_file_path_ file already exists exception is thrown.

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

Examples

  • The following example retrieves all licenses that are installed on the XClarity Administrator server.

    $cred = Get-Credential 
    Connect-LXCA -Host 192.0.2.0 -Credential $cred

    $license = Get-LXCAQuantityLicense

    # show all the information about the request:
    # - Result value,
    # - Message if any,
    # - brief description of the licenses data if any.
    $license

    # show detailed information about the installed licenses.
    $license.Licenses

    Disconnect-LXCA
  • The following example exports specific licenses (using the -LicensesIds parameter) to the local system and returns the fully-qualified path of the file. If the file with same name already exists, the old file is replaced. The file name used for the exported file is the one that is returned by XClarity Administrator.

    $cred = Get-Credential 
    Connect-LXCA -Host 192.0.2.0 -Credential $cred

    $file = Get-LXCAQuantityLicense -LicenseIds 1,5 -Destination C:\LXCA\ -Overwrite
    $file

    Disconnect-LXCA