Skip to main content

Get-LXCADevicesWarranty

This cmdlet retrieves or downloads information about warranties for managed devices.

Note
You cannot pipe objects to this cmdlet.

Syntax

To retrieve information about all warranties or all warranties in a specific state, use the following syntax.
Get-LXCADevicesWarranty [-Connection LXCAConnection]
[-WarrantyStatusType String]
[CommonParameter]
To download information about all warranties, use the following syntax.
Get-LXCADevicesWarranty [-Connection LXCAConnection]
-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.
-WarrantyStatusType String
Status of the warranties that you want to retrieve. This can be one of the following values.
  • All. (default) Returns information about all warranties.

  • ActiveOnly. Returns information about all active warranties.

  • ExpiredOnly. Returns information about all expired warranties.

  • NotAvailableOnly. Returns information about warranties for which the status is not available.

-Destination String
Directory and file name where the file is to be saved on the local system.
  • If you do not specify a file name (in other words, if the destination ends in a back slash "\"), the default file name (warrantyInfo-nn.csv.) is used.

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

-Overwrite
When specified, if the file already exists in the specified directory, the file is overwritten.

If not specified, and the file already exists in the specified directory, the file is not overwritten and the System.IO.IOException: The <full_csv_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

If –Destination is not specified, this cmdlet returns a Lenovo.SysMgmt.LXCA.Integration.Data.WarrantyInfo array that contains information for all warranties or for all warranties in a specific state.

If –Destination is specified, this cmdlet returns a System.String object that contains the full path of the saved csv file, and downloads the file to the specified directory on the local system.

Examples

  • The following example returns information about all expired warranties.

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

    # $result contains an array of WarrantyInfo objects with expired Warranty Status.
    $result = Get-LXCADevicesWarranty -WarrantyStatusType ExpiredOnly
    $result

    Disconnect-LXCA
  • The following example downloads all warranty information as a *csv file in the $PSScriptRoot\..\_lxca\warranties directory using the default file name. If the file already exists, the file is overwritten.

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

    # $result contains the full path of the saved csv file.
    $result = Get-LXCADevicesWarranty -Destination "$PSScriptRoot\..\_lxca\warranties\" –Overwrite
    $result

    Disconnect-LXCA