Add-LXC1Devices
This cmdlet to manage one or more discovered devices.
Note
When managing a large number of devices, multiple requests are generated.
You cannot pipe objects to this cmdlet.
Syntax
Add-LXC1Devic -UserName String
-Password SecureString
[-NewPassword SecureString]
-HubID String]
-DeviceUUIDs String[]
[-Connection LXC1Connection]
[CommonParameter]
Parameters
- -UserName String
- User name
- -Password SecureString
- Password
- -NewPassword SecureString
- New password that you want to change on selected devices that require a new password
- -HubID String
- Management hub ID
- -DeviceUUIDs String[]
- List of UUIDs of discovered devices to manage, separated by a comma
- -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
System.String[]
This cmdlet returns a string that contains the ID of the job or a string array that contains IDs for all jobs that were created for the request.
Lenovo.XC1.PowerShell.Automation.Data.RequestStatusMessage
If the request fails, an RequestStatusMessage object is returned with failure details.
Examples
The following example manages discovered devices to a hub. The example assumes that only one hub is registered with the portal.
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
$passwd = ConvertTo-SecureString $ServerPassword -AsPlainText -Force
$manager = Get-LXC1Managers
$devices = Get-LXC1DiscoveredDevice
$hubID = $manager.Response.results[0].id
$devicesIDs = @()
foreach($dev in $devices.Response.results)
{
$devicesIDs += $dev.uuid
}
$result = Add-LXC1Devices -UserName $ServerUsername `
-Password $passwd `
-HubID $hubID `
-DeviceIDs $devicesIDs
# likelly, display manage job ID.
$result
Give documentation feedback