Skip to main content

Remove-LXC1Devices

This cmdlet unmanages one or more managed devicesalert.

Note
  • When unmanaging a large number of devices, multiple requests are generated.

  • You cannot pipe objects to this cmdlet.

Syntax

Remove-LXC1Devices -DeviceIDs String[]
[-Connection LXC1Connection]
[CommonParameter]
]
Parameters
-DeviceIDs String[]
Specifies one or more IDs of the devices to be unmanaged.
-Connection LXC1Connection
Specifies the connection to the XClarity One server. If no connection is specified, the result from the last Connect-LXC1 cmdlet is used.
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 unmanages all managed devices.
param ( 
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ServerUsername,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ServerPassword
)

$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

$devices = Get-LXC1Device

$devicesIDs = @()
foreach($dev in $devices.Response.results)
{
$devicesIDs += $dev.id
}
$devicesIDs

$result = Remove-LXC1Devices -DeviceIDs $devicesIDs

# likelly, display the unmanage job ID.
$result