Find-LXCODevices
This cmdlet directly discovers manageable Lenovo devices by specifying an individual IP addresses or hostname, range of IP addresses, or subnet.
Note
You cannot pipe objects to this cmdlet.
Syntax
Find-LXCODevices [-Connection LXCOConnection]
-Hosts HostsToDiscover[]
[CommonParameter]
Find-LXCODevices [-Connection LXCOConnection]
-Ranges RangesToDiscover[]
[CommonParameter]
Find-LXCODevices [-Connection LXCOConnection]
-Subnets SubnetsToDiscover[]
[CommonParameter]
Find-LXCODevices [-Connection LXCOConnection]
-Discover ToDiscover
[CommonParameter]
Find-LXCODevices [-Connection LXCOConnection]
-AsJSON String
[CommonParameter]
Parameters
- -Connection LXCOConnection
- Specifies the connection to the Lenovo XClarity Orchestrator server. If no connection is specified, the result from the last Connect-LXCO cmdlet is used.
- -Hosts HostsToDiscover[]
- Specifies one or more hosts to be discovered by one or more resource managers.
- -Ranges RangesToDiscover[]
- Specifies one or more ranges of IP addresses for devices to be discovered by one or more resource managers.
- -Subnets SubnetsToDiscover[]
- Specifies one or more subnets in which to discover manageable devices by one or more resource managers.
- -Discover ToDiscover[]
Specifies the devices to be discovered by one or more resource managers, by IP address or host name, range of IP addresses and subnet.
- -AsJSON String
- Specifies the devices to be discovered by one or more resource managers, as a JSON string.
- 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.XClarityOrchestrator.PowerShell.Data.LXCOJobFullData
If the request was accepted the orchestrator server, this cmdlet returns an LXCOJobFullData object that contains the status of the operation that is associated with this request. If available, job logs are added to the root job and subtasks.
- Lenovo.XClarityOrchestrator.PowerShell.Data.RequestStatusMessage
If an error occurred, this cmdlet returns a RequestStatusMessage object that contains information about the reason of the failure.
Examples
The following example discovers manageable devices specified as hostnames, IP-address ranges, and subnets.
$cred = Get-Credential
Connect-LXCO -HostUri 10.10.2.0 -Credential $cred -SkipCertificateCheck
$managers = Get-LXCOManagers
# this snippet of code applies only for 2 managers: one lxca and one MH 2.0
# for more managers, further filtering is required :)
$lxcaID = $($managers | Where-Object {$_.ManagerType -eq "XClarity Administrator"}).Id
$mHubID = $($managers | Where-Object {$_.ManagerType -eq "XClarity Management Hub 2.0"}).Id
#region hosts to discover
$servers0 = @("10.21.6.130", "10.21.2.64")
$servers2 = @("10.21.6.60", "10.21.6.56")
$lxcaManagerHosts = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.HostsToDiscover `
-Property @{Hosts = $serverso; ManagerID = $lxcaID}
$hubManagerHosts = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.HostsToDiscover `
-Property @{Hosts = $servers2; ManagerID = $mHubID}
$hosts = @($lxcaManagerHosts, $hubManagerHosts)
#endregion
#region ranges to discover
$rangeE1 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Range `
-Property @{StartIp = "10.41.3.53"; EndIP = "10.41.3.55"}
$rangeE2 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Range `
-Property @{StartIp = "10.41.3.57"; EndIP = "10.41.6.60"}
$rangeG1 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Range `
-Property @{StartIp = "10.51.9.61"; EndIP = "10.51.9.65"}
$rangeG2 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Range `
-Property @{StartIp = "10.51.9.56"; EndIP = "10.51.9.56"}
$lxcaManagerRanges = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.RangesToDiscover `
-Property @{Ranges = @($rangeE2, $rangeG1); ManagerID = $lxcaID}
$hubManagerRanges = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.RangesToDiscover `
-Property @{Ranges = @($rangeE1, $rangeG2); ManagerID = $mHubID }
$ranges = @($lxcaManagerRanges, $hubManagerRanges)
#endregion
#region subnets to discover
$subnet1 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Subnet `
-Property @{IPAddress = "10.71.32.0"; Mask = "255.255.255.128"}
$subnet2 = New-Object -TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.Subnet `
-Property @{IPAddress = "10.71.36.128"; Mask = "255.255.255.128"}
$lxcaManagerSubnets = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.SubnetsToDiscover `
-Property @{Subnets = @($subnet1); ManagerID = $lxcaID}
$hubManagerSubnets = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.SubnetsToDiscover `
-Property @{Subnets = @($subnet2); ManagerID = $mHubID }
$subnets = @($lxcaManagerSubnets, $hubManagerSubnets)
#endregion
#region add all data
$toDiscover = New-Object `
-TypeName Lenovo.XClarityOrchestrator.PowerShell.Data.Discovery.ToDiscover `
-Property @{Hosts = $hosts; Ranges = $ranges; Subnets = $subnets}
#endregion
$result = Find-LXCODevices -Discover $toDiscover
$result
Disconnect-LXCO
The following example discovers manageable devices specified in JSON format.
$cred = Get-Credential
Connect-LXCO -HostUri 10.10.2.0 -Credential $cred -SkipCertificateCheck
$obj = @{
hosts = @(
@{host = "10.21.6.130"; managerID = "AAAAA"}
@{host = "10.21.2.64"; managerID = "AAAAA"}
@{host = "10.21.6.60"; managerID = "BBBBB"}
@{host = "10.21.6.56"; managerID = "BBBBB"}
)
ranges = @(
@{start = "10.41.3.57"; end = "10.41.3.60"; managerID = "AAAAA"}
@{start = "10.41.3.61"; end = "10.41.3.65"; managerID = "AAAAA"}
@{start = "10.51.9.53"; end = "10.51.9.55"; managerID = "BBBBBCCC"}
@{start = "10.51.9.56"; end = "10.51.9.56"; managerID = "CCCCCDDD"}
)
subnets = @(
@{ipAddress = "10.71.32.0"; mask = "255.255.255.128"; managerID = "AAAAA"}
@{ipAddress = "10.71.32.128"; mask = "255.255.255.128"; managerID = "BBBBBB"}
)
}
$json = ConvertTo-Json -InputObject $obj -Compress
$result = Find-LXCODevices -AsJSON $json
$result
Disconnect-LXCO
Give documentation feedback