Skip to main content

Set-LXCASwitchPort

This cmdlet enables or disables ports on a managed RackSwitch or Flex System switch.

Note
You cannot pipe objects to this cmdlet.

Syntax

Set-LXCASwitchPort [-Connection LXCAConnection]
-Action String
-Port String[]
-Uuid String
[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.
-Action String

Specifies whether to enable or disable the specified ports. This can be of the following values:

  • enable

  • disable

To determine the current state of the port, use the Get-LXCARackSwitch cmdlet.

-Port String[]
Specifies the name of one or more ports. To obtain the port names, use the Get-LXCARackSwitch cmdlet.
-Uuid String
Specifies the UUID a managed RackSwitch or Flex System switch that contains the ports to be changed.
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

This cmdlet modifies the port state. No object is returned.

Examples

  • The following example disables specific ports in a managed switch.

    $cred = Get-Credential
    Connect-LXCA -Host 1.111.11.11 -Port 443 -Credential $cred

    Set-LXCASwitchPort –Action disable –Port "Ethernet1/1","Ethernet1/3" –Uuid AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    Disconnect-LXCA
  • The following example enables all ports in a managed switch.

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

    $rackSwitch = Get-LXCARackSwitch –Uuid AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    $portList=@();
    foreach($i in $rackswitch.Ports) { $portList+=( ,$i.Port)}
    Set-LXCASwitchPort –Action enable –Port $portList –Uuid AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    Disconnect-LXCA