{"id":21651941,"url":"https://github.com/poweraruba/powerarubacx","last_synced_at":"2025-04-11T20:32:58.553Z","repository":{"id":34618977,"uuid":"142456563","full_name":"PowerAruba/PowerArubaCX","owner":"PowerAruba","description":"PowerShell module to manage ArubaCX switches ","archived":false,"fork":false,"pushed_at":"2025-01-22T12:25:40.000Z","size":636,"stargazers_count":16,"open_issues_count":12,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T16:23:04.408Z","etag":null,"topics":["api-rest","aruba","aruba-switch","arubaos-cx","cmdlets","hpe","networking","powershell","powershell-module","switch","vlan","vlans-management"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerAruba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-26T15:01:01.000Z","updated_at":"2025-01-25T09:19:14.000Z","dependencies_parsed_at":"2024-11-25T07:50:23.977Z","dependency_job_id":"ac6e6537-6b8f-4c50-b0fe-5a7a15a254fd","html_url":"https://github.com/PowerAruba/PowerArubaCX","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAruba%2FPowerArubaCX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAruba%2FPowerArubaCX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAruba%2FPowerArubaCX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerAruba%2FPowerArubaCX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerAruba","download_url":"https://codeload.github.com/PowerAruba/PowerArubaCX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476226,"owners_count":21110235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","aruba","aruba-switch","arubaos-cx","cmdlets","hpe","networking","powershell","powershell-module","switch","vlan","vlans-management"],"created_at":"2024-11-25T07:50:20.143Z","updated_at":"2025-04-11T20:32:58.501Z","avatar_url":"https://github.com/PowerAruba.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerArubaCX\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.powershellgallery.com/packages/PowerArubaCX/\" alt=\"PowerShell Gallery Version\"\u003e\n        \u003cimg src=\"https://img.shields.io/powershellgallery/v/PowerArubaCX.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.powershellgallery.com/packages/PowerArubaCX/\" alt=\"PS Gallery Downloads\"\u003e\n        \u003cimg src=\"https://img.shields.io/powershellgallery/dt/PowerArubaCX.svg\" /\u003e\u003c/a\u003e\n    \u003c!--\n    \u003ca href=\"https://www.powershellgallery.com/packages/PowerArubaCX/\" alt=\"PS Platform\"\u003e\n        \u003cimg src=\"https://img.shields.io/powershellgallery/p/PowerArubaCX.svg\" /\u003e\u003c/a\u003e\n    --\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/PowerAruba/PowerArubaCX/graphs/commit-activity\" alt=\"GitHub Last Commit\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/last-commit/PowerAruba/PowerArubaCX/master.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://raw.githubusercontent.com/PowerAruba/PowerArubaCX/master/LICENSE\" alt=\"GitHub License\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/PowerAruba/PowerArubaCX.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PowerAruba/PowerArubaCX/graphs/contributors\" alt=\"GitHub Contributors\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/contributors/PowerAruba/PowerArubaCX.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://twitter.com/PowerAruba\" alt=\"Twitter\"\u003e\n            \u003cimg src=\"https://img.shields.io/twitter/follow/PowerAruba.svg?style=social\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis is a Powershell module for configure an ArubaCX Switch.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/PowerAruba/PowerArubaCX/master/Medias/PowerArubaCX.png\" width=\"250\" height=\"250\" /\u003e\n\u003c/p\u003e\n\nWith this module (version 0.6.0) you can manage:\n\n- [Firmware](#firmware) (Get)\n- [Interfaces](#interface) (Add/Get/Set/Remove [LAG](#interface-lag), [Loopback](#interface-loopback), [Vlans](#interface-vlans))\n- [LLDP Neighbor](#lldp-neighbor) (Get)\n- [System](#System) (Get/Set)\n- [Users](#Users) (Get)\n- [Vlans](#Vlans-Management) (Add/Get/Set/Remove)\n- [VRF](#vrf) (Add/Get/Set/Remove)\n- [VM](#vm) (Deploy and Configure ArubaCX OVA (for initial setup))\n\nThere is some extra feature\n- [Invoke API](#Invoke-API) using Invoke-ArubaCXRestMethod\n\u003c!-- - [Filtering](#Filtering) --\u003e\n- [Multi Connection](#MultiConnection)\n\nMore functionality will be added later.\n\nTested with ArubaCX 8400 and 832x, 6x00 (using \u003e= 10.06.xx firmware) on Windows/Linux/macOS\n\n# Usage\n\nAll resource management functions are available with the Powershell verbs GET, ADD, SET, REMOVE.\n\nFor example, you can manage Vlans with the following commands:\n- `Get-ArubaCXVlans`\n- `Add-ArubaCXVlans`\n- `Set-ArubaCXVlans`\n- `Remove-ArubaCXVlans`\n\n# Requirements\n\n- Powershell 7 (Core) or 5 (If possible get the latest version)\n- An ArubaCX Switch (with firmware \u003e= 10.06.xx) and REST API enable\n\n# Instructions\n### Install the module\n```powershell\n# Automated installation (Powershell 5 and later):\n    Install-Module PowerArubaCX\n\n# Import the module\n    Import-Module PowerArubaCX\n\n# Get commands in the module\n    Get-Command -Module PowerArubaCX\n\n# Get help\n    Get-Help Invoke-ArubaCXRestMethod -Full\n```\n\n# Examples\n### Connecting to the Aruba Switch\n\nThe first thing to do is to connect to an ArubaCX Switch with the command `Connect-ArubaCX`:\n\n```powershell\n# Connect to the Aruba CX Switch\n    Connect-ArubaCX 192.0.2.1\n\n#we get a prompt for credential\n```\n\n\n### Vlans Management\n\nYou can create a new Vlan `Add-ArubaCXVlans`, retrieve its information `Get-ArubaCXVlans`, modify its properties `Set-ArubaCXVlans`, or delete it `Remove-ArubaCXVlans`.\n\n```powershell\n# Create a vlan\n    Add-ArubaCXVlans -id 85 -Name 'PowerArubaCX'\n\n    [...]\n    admin                             : up\n    clear_ip_bindings                 :\n    description                       :\n    [...]\n    id                                : 85\n    [...]\n    name                              : PowerArubaCX\n    nd_snoop_config                   : @{enable=False; ra_drop_enable=False}\n    nd_snooping_prefix                : {}\n    oper_state                        : down\n    oper_state_reason                 : no_member_port\n    [...]\n    type                              : static\n    voice                             : False\n    vsx_sync                          : {}\n\n\n# Get information about vlan\n    Get-ArubaCXVlans -id 85 -attributes admin, description, id, name, type, voice | Format-Table\n\n    admin description id name         type   voice\n    ----- ----------- -- ----         ----   -----\n    up                85 PowerArubaCX static False\n\n# Change settings of a vlan (Description and voice)\n    Get-ArubaCXVlans -id 85 | Set-ArubaCXVlans -description \"Add via PowerArubaCX\" -voice\n\n    [...]\n    admin                             : up\n    clear_ip_bindings                 :\n    description                       : Add via PowerArubaCX\n    [...]\n    id                                : 85\n    [...]\n    name                              : PowerArubaCX\n    nd_snoop_config                   : @{enable=False; ra_drop_enable=False}\n    nd_snooping_prefix                : {}\n    oper_state                        : down\n    oper_state_reason                 : no_member_port\n    [...]\n    type                              : static\n    voice                             : True\n    vsx_sync                          : {}\n\n\n# Remove a vlan\n    Get-ArubaCXVlans -name PowerArubaCX | Remove-ArubaCXVlans\n```\n\nFor configure a vlan to an interface, need to use [Set-ArubaCXInterfaces](#Interface)\n\n### Invoke API\nfor example to get ArubaCX System Configuration\n\n```powershell\n# get Aruba CX System configuration using API\n    Invoke-ArubaCXRestMethod -method \"get\" -uri \"system\" -selector configuration\n\n    aaa                                : @{fail_through=False; login_lockout_time=300; radius_auth=pap; radius_retries=1;\n                                        radius_timeout=5; ssh_passkeyauthentication_enable=True;\n                                        ssh_publickeyauthentication_enable=True; tacacs_auth=pap; tacacs_timeout=5}\n    all_user_copp_policies             : {}\n    arp_config                         : @{gc_threshold=131072; timeout=30}\n    bfd_detect_multiplier              : 5\n    bfd_echo_disable                   : False\n    bfd_enable                         : False\n    bfd_min_echo_rx_interval           : 500\n    bfd_min_rx_interval                : 3000\n    bfd_min_tx_interval                : 3000\n    checkpoint_post_config             : @{disable=False; timeout=300}\n    dhcp_config                        :\n    dlog_destination                   :\n    dns_servers                        : {}\n    ecmp_config                        :\n    hostname                           : PowerArubaCX-SW1\n    hpe_rda_enable                     : False\n    icmp_redirect_disable              : False\n    icmp_unreachable_disable           : False\n    icmp_unreachable_ratelimit         : 1000\n\n[...]\n# get only Aruba CX System hostname and dns servers\n    Invoke-ArubaCXRestMethod -method \"get\" -uri \"system\" -attributes hostname, dns_servers\n\n    dns_servers hostname\n    ----------- --------\n    {}          PowerArubaCX-SW1\n```\n\n\u003c!--\n# get only Aruba CX Interfaces with depth 2 and attributes name...\n    Invoke-ArubaCXRestMethod -method \"get\" -uri \"system/interfaces\" -depth 2 -attributes name, admin\n\n    name          admin\n    ----          ------\n    bridge_normal @{error=up}\n    1/1/1         @{error=up}\n    vlan55        @{error=up}\n    1/1/3         @{error=up}\n    1/1/2         @{error=up}\n    lag1          @{error=up}\n    lag2          @{error=up}\n    lag5          @{error=up}\n    1/1/6         @{error=up}\n--\u003e\n\n\nto get API uri, go to ArubaCX Swagger (https://ArubaCX-IP/api/v10.04/)\n![](./Medias/ArubaCX_API.png)\n\nAnd choice a service (for example System)\n![](./Medias/ArubaCX_API_system.png)\n\n### Interface\n\nOn ArubaCX, on interface, there is all type of interface physical/system and virtual (LAG, Loopback, Vlans)\n\nYou can create a new interface (LAG, Loopback, Vlans) `Add-ArubaCXInterfaces`, retrieve its information `Get-ArubaCXInterfaces`, modify its properties `Set-ArubaCXInterfaces` or delete it `Remove-ArubaCXInterfaces`. There is also extra cmdlets for Add `Add-ArubaCXInterfacesVlansTrunks` / Remove `Remove-ArubaCXInterfacesVlansTrunks` Vlans trunks on interface (physical or LAG) or for Add  `Add-ArubaCXInterfacesLagInterface` or Remove  `Remove-ArubaCXInterfacesLagInterface` member (physical) interface on LAG.\n\n\n#### Interface Physical (System)\n\n```powershell\n\n#Get interface 1/1/1 configuration\n    Get-ArubaCXInterfaces 1/1/1 -selector configuration\n\n    aaa_auth_precedence                  :\n    aclmac_in_cfg                        :\n    aclmac_in_cfg_version                :\n    aclmac_out_cfg                       :\n    aclmac_out_cfg_version               :\n    aclv4_in_cfg                         :\n    aclv4_in_cfg_version                 :\n    aclv4_out_cfg                        :\n    aclv4_out_cfg_version                :\n    aclv6_in_cfg                         :\n    aclv6_in_cfg_version                 :\n    aclv6_out_cfg                        :\n    aclv6_out_cfg_version                :\n    admin                                : up\n    [...]\n\n#Get name, admin state and link state of interface\n\n    Get-ArubaCXInterfaces 1/1/1 -attributes name, admin_state, link_state\n\n    admin_state link_state name\n    ----------- ---------- ----\n    down        down       1/1/1\n\n#Configure interface 1/1/1 (Description, admin and routing)\n\n    Get-ArubaCXInterfaces 1/1/1 | Set-ArubaCXInterfaces -description \"Changed by PowerArubaCX\" -admin up -routing:$false\n\n    [...]\n    admin                                   : up\n    [...]\n    description                             : Changed by PowerArubaCX\n    [...]\n    name                                    : 1/1/1\n    [...]\n    routing                                 : False\n    [...]\n\n#Configure interface 1/1/1 on vlan access 85\n\n    Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -vlan_mode access -vlan_tag 85\n\n    name                                    : 1/1/1\n    [...]\n    vlan_mode                               : access\n    vlan_tag                                : @{85=/rest/v10.04/system/vlans/85}\n    [...]\n\n#Configure interface 1/1/1 on native-untagged mode with vlan 85 and tagged vlan 44\n\n    Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -vlan_mode native-untagged -vlan_tag 85 -vlan_trunks 44\n\n    name                                    : 1/1/1\n    [...]\n    vlan_mode                               : native-untagged\n    vlan_tag                                : @{85=/rest/v10.04/system/vlans/85}\n    vlan_trunks                             : @{44=/rest/v10.04/system/vlans/44}\n\n#Configure interface 1/1/1 and add vlan 45 to trunks\n\n    Get-ArubaCXInterfaces -interface 1/1/1 | Add-ArubaCXInterfacesVlanTrunks -vlan_trunks 45\n\n    name                                    : 1/1/1\n    [...]\n    vlan_mode                               : native-untagged\n    vlan_tag                                : @{85=/rest/v10.04/system/vlans/85}\n    vlan_trunks                             : @{44=/rest/v10.04/system/vlans/44; 45=/rest/v10.04/system/vlans/45}\n    [...]\n\n#Configure interface 1/1/1 with a IPv4 address\n\n    Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -ip4_address 192.0.2.1 -ip4_mask 24\n\n    name                                    : 1/1/1\n    [...]\n    ip4_address                             : 192.0.2.1/24\n    [...]\n```\n\n#### Interface LAG\n\n```powershell\n\n#Add LAG 1 with member interface 1/1/1\n\n    Add-ArubaCXInterfaces -lag_id 1 admin up -interfaces 1/1/3 -lacp active\n\n    name                                    : lag1\n    [...]\n    interfaces                              : @{1/1/3=/rest/v10.09/system/interfaces/1%2F1%2F3}\n    [...]\n    lacp                                    : active\n    [...]\n\n#Configure Access vlan 44 on LAG 1\n\n    Get-ArubaCXInterfaces lag1 | Set-ArubaCXInterfaces -vlan_tag 44 -vlan_mode access\n\n    name                                    : lag1\n    [...]\n    vlan_mode                               : access\n    vlan_tag                                : @{44=/rest/v10.09/system/vlans/44}\n    [...]\n\n#Configure Trunk vlan 44,45 on LAG 1\n\n    Get-ArubaCXInterfaces lag1 | Set-ArubaCXInterfaces -vlan_tag 1 -vlan_trunks 44,45 -vlan_mode native-untagged \n\n    name                                    : lag1\n    [...]\n    vlan_mode                               : native-untagged\n    vlan_tag                                : @{1=/rest/v10.09/system/vlans/1}\n    vlan_trunks                             : @{44=/rest/v10.09/system/vlans/44; 45=/rest/v10.09/system/vlans/45}\n    [...]\n\n#Add interface 1/1/2 on LAG 1\n\n    Get-ArubaCXInterfaces lag1 | Add-ArubaCXInterfacesLagInterfaces -interfaces 1/1/2\n\n    name                                    : lag1\n    [...]\n    interfaces                              : @{1/1/2=/rest/v10.09/system/interfaces/1%2F1%2F2; 1/1/3=/rest/v10.09/system/interfaces/1%2F1%2F3}\n    [...]\n    lacp                                    : active\n    [...]\n\n#Remove interface 1/1/3 on LAG 1\n\n    Get-ArubaCXInterfaces lag1 | Remove-ArubaCXInterfacesLagInterfaces -interfaces 1/1/3\n\n    name                                    : lag1\n    [...]\n    interfaces                              : @{1/1/2=/rest/v10.09/system/interfaces/1%2F1%2F2}\n    [...]\n    lacp                                    : active\n    [...]\n\n#Remove LAG 1\n\n    Get-ArubaCXInterfaces lag1 | Remove-ArubaCXInterfaces\n\n    Confirm\n    Are you sure you want to perform this action?\n    Performing the operation \"Remove interface\" on target \"lag1\".\n    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is \"Y\"): Y\n```\n\n#### Interface Loopback\n\n```powershell\n\n#Add interface loopback 1 with a IPv4 Address (you need to add vlan before)\n\n    Add-ArubaCXInterfaces -loopback_id 1 -ip4_address 192.0.2.44 -ip4_mask 24\n\n    name                                    : loopback1\n    [...]\n    active_ip4_address                      : 192.0.2.44/24\n    [...]\n    ip4_address                             : 192.0.2.44/24\n    [...]\n\n#Change IP Address of interface loopback 1\n\n    Get-ArubaCXInterfaces loopback1 | Set-ArubaCXInterfaces -ip4_address 192.0.2.254 -ip4_mask 24\n\n    name                                    : loopback1\n    [...]\n    active_ip4_address                      : 192.0.2.254/24\n    [...]\n    ip4_address                             : 192.0.2.254/24\n    [...]\n\n#Set VRF Blue on interface loopback 1(need to create vrf before)\n\n    Get-ArubaCXInterfaces loopback1 | Set-ArubaCXInterfaces -vrf blue\n\n    name                                    : loopback1\n    [...]\n    vrf                                     : @{blue=/rest/v10.09/system/vrfs/blue}\n    [...]\n\n#Remove interface loopback 1\n\n    Get-ArubaCXInterfaces loopback1 | Remove-ArubaCXInterfaces\n\n    Confirm\n    Are you sure you want to perform this action?\n    Performing the operation \"Remove interface\" on target \"loopback1\".\n    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is \"Y\"): Y\n```\n\n#### Interface Vlans\n\n```powershell\n\n#Add interface vlan 44 with a IPv4 Address (you need to add vlan before)\n\n    Add-ArubaCXInterfaces -vlan_id 44 -ip4_address 192.0.2.44 -ip4_mask 24\n\n    name                                    : vlan44\n    [...]\n    active_ip4_address                      : 192.0.2.44/24\n    [...]\n    ip4_address                             : 192.0.2.44/24\n    [...]\n\n#Change IP Address of interface vlan 44\n\n    Get-ArubaCXInterfaces vlan44 | Set-ArubaCXInterfaces -ip4_address 192.0.2.254 -ip4_mask 24\n\n    name                                    : vlan44\n    [...]\n    active_ip4_address                      : 192.0.2.254/24\n    [...]\n    ip4_address                             : 192.0.2.254/24\n    [...]\n\n#Set VRF Blue on interface vlan 44 (need to create vrf before)\n\n    Get-ArubaCXInterfaces vlan44 | Set-ArubaCXInterfaces -vrf blue\n\n    name                                    : vlan44\n    [...]\n    vrf                                     : @{blue=/rest/v10.09/system/vrfs/blue}\n    [...]\n\n#Remove interface vlan 44\n\n    Get-ArubaCXInterfaces vlan44 | Remove-ArubaCXInterfaces\n\n    Confirm\n    Are you sure you want to perform this action?\n    Performing the operation \"Remove interface\" on target \"vlan44\".\n    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is \"Y\"): Y\n```\n\n### LLDP Neighbor\n\n```powershell\n\n#Get LLDP Neighbor of All Ports\n\n    Get-ArubaCXLLDPNeighbor\n\n    %2F1%2F8                                                                                                                1%2F1%2F9\n    ---------                                                                                                                ---------\n    @{08:00:09:0d:2d:06,1/1/9=/rest/v10.09/system/interfaces/1%2F1%2F8/lldp_neighbors/08%3A00%3A09%3A0d%3A2d%3A06,1%2F1%2F9} @{08:00:09:0d:2d:06,1/1/8=/rest/v10.09/system/interfaces/1%2F1%2F9/lldp_neighbors/08%3A00%3A09%3…\n\n#Get LLDP Neighbor of port 1/1/8 with depth 2\n\n    Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2\n\n    08:00:09:0d:2d:06,1/1/9\n    -----------------------\n    @{chassis_id=08:00:09:0d:2d:06; dcbx_cee_status=; mac_addr=08:00:09:0d:2d:06; med_network_policy=; neighbor_info=; neighbor_info_organizational=; port_id=1/1/9}\n\n#To Get all info, you can use\n\n    (Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2).'08:00:09:0d:2d:06,1/1/9'\n\n    chassis_id                   : 08:00:09:0d:2d:06\n    dcbx_cee_status              :\n    mac_addr                     : 08:00:09:0d:2d:06\n    med_network_policy           :\n    neighbor_info                : @{associated_poe_tlv_for_pd=dot3; chassis_capability_available=Bridge, Router; chassis_capability_enabled=Bridge, Router; chassis_description=Aruba ABC123  Virtual.10.09.0002;\n                                chassis_id_len=6; chassis_id_subtype=link_local_addr; chassis_index=1; chassis_name=switch; chassis_protocol=LLDP; chassis_refcount=2; chassis_ttl=120; eee_wake_time_fallback=0;\n                                eee_wake_time_rx=0; eee_wake_time_rx_echo=0; eee_wake_time_tx=0; eee_wake_time_tx_echo=0; macphy_autoneg_advertised=Other; macphy_autoneg_enabled=0; macphy_autoneg_support=0;\n                                macphy_mau_type= ; mgmt_iface_list=33554433; mgmt_iface_oid_list=1.3.6.1.2.1.31.1.1.1.1.33554433; mgmt_ip_list=192.0.2.44; pd_dot3_ext_tlv_advertised=False; pd_dot3_tlv_advertised=False;\n                                pd_med_tlv_advertised=False; port_description=1/1/9; port_hidden_in=0; port_hidden_out=0; port_id_len=5; port_id_subtype=if_name;port_lastchange=61ed751e; port_lastupdate=61ed764a;\n                                port_mfs=0; port_protocol=LLDP; power_allocated=0; power_allocated_pair_a=0; power_allocated_pair_b=0; power_class=Class0; power_devicetype=PSE; power_enabled=1; power_paircontrol=0;\n                                power_pairs=SIGNAL; power_powertype=None; power_priority=Unknown; power_requested=0; power_requested_pair_a=0; power_requested_pair_b=0; power_source=Unknown; power_supported=1;\n                                remote_index=2}\n    neighbor_info_organizational : @{1=; 2=; 3=}\n    port_id                      : 1/1/9\n\n#and for neighbor info\n\n    (Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2).'08:00:09:0d:2d:06,1/1/9'.neighbor_info\n\n    associated_poe_tlv_for_pd    : dot3\n    chassis_capability_available : Bridge, Router\n    chassis_capability_enabled   : Bridge, Router\n    chassis_description          : Aruba ABC123  Virtual.10.09.0002\n    chassis_id_len               : 6\n    chassis_id_subtype           : link_local_addr\n    chassis_index                : 1\n    chassis_name                 : switch\n    chassis_protocol             : LLDP\n    chassis_refcount             : 2\n    chassis_ttl                  : 120\n    eee_wake_time_fallback       : 0\n    eee_wake_time_rx             : 0\n    eee_wake_time_rx_echo        : 0\n    eee_wake_time_tx             : 0\n    eee_wake_time_tx_echo        : 0\n    macphy_autoneg_advertised    : Other\n    macphy_autoneg_enabled       : 0\n    macphy_autoneg_support       : 0\n    macphy_mau_type              :\n    mgmt_iface_list              : 33554433\n    mgmt_iface_oid_list          : 1.3.6.1.2.1.31.1.1.1.1.33554433\n    mgmt_ip_list                 : 192.0.2.44\n    pd_dot3_ext_tlv_advertised   : False\n    pd_dot3_tlv_advertised       : False\n    pd_med_tlv_advertised        : False\n    port_description             : 1/1/9\n    port_hidden_in               : 0\n    port_hidden_out              : 0\n    port_id_len                  : 5\n    port_id_subtype              : if_name\n    port_lastchange              : 61ed751e\n    port_lastupdate              : 61ed7686\n    port_mfs                     : 0\n    port_protocol                : LLDP\n    power_allocated              : 0\n    power_allocated_pair_a       : 0\n    power_allocated_pair_b       : 0\n    power_class                  : Class0\n    power_devicetype             : PSE\n    power_enabled                : 1\n    power_paircontrol            : 0\n    power_pairs                  : SIGNAL\n    power_powertype              : None\n    power_priority               : Unknown\n    power_requested              : 0\n    power_requested_pair_a       : 0\n    power_requested_pair_b       : 0\n    power_source                 : Unknown\n    power_supported              : 1\n    remote_index                 : 2\n\n```\n\n### Firmware\nTor Get Firmware information on Aruba CX Switch\n\n```powershell\n\n#Get Firmware info\n\n    Get-ArubaCXFirmware -attribute current_version -Verbose\n\n    current_version   : FL.10.09.0002\n    primary_version   : FL.10.09.0002\n    secondary_version : FL.10.09.0002\n    default_image     : primary\n    booted_image      : primary\n\n#Get Firmware Status\n\n    Get-ArubaCXFirmware -status\n\n    date reason status\n    ---- ------ ------\n    0    none   none\n\n```\n\n### System\nfor example to get/set ArubaCX System settings\n\n```powershell\n\n#Get ALL system settings\n\n    Get-ArubaCXSystem\n\n    aaa                                             : @{dot1x_auth_enable=False; dot1x_remote_auth_method=eap-radius; fail_through=False; login_lockout_time=300; \n                                                    mac_auth_address_format=no-delimiter; mac_auth_enable=False; mac_auth_radius_auth_method=chap; \n                                                    portaccess_local_accounting_enable=False; radius_auth=pap; radius_retries=1; radius_timeout=5; \n                                                    radius_tracking_time_interval=300; radius_tracking_user_name=radius-tracking-user; tacacs_auth=pap; \n                                                    tacacs_timeout=5; tacacs_tracking_time_interval=300; tacacs_tracking_user_name=tacacs-tracking-user}\n    aaa_accounting_attributes                       : /rest/v10.04/system/aaa_accounting_attributes\n    aaa_server_group_prios                          : /rest/v10.04/system/aaa_server_group_prios\n    aaa_server_groups                               : /rest/v10.04/system/aaa_server_groups\n    acl_object_groups                               : /rest/v10.04/system/acl_object_groups\n    acls                                            : /rest/v10.04/system/acls\n    admin_password_set                              : True\n    [...]\n\n#Get hostname and timezone system settings\n\n    Get-ArubaCXSystem -attribute hostname, timezone\n\n    hostname    timezone\n    --------    --------\n    switch      UTC\n\n#Set hostname\n\n    Set-ArubaCXSystem -hostname PowerArubaCX-Switch\n\n    [...]\n    hostname                                        : PowerArubaCX-Switch\n    [...]\n\n#Set timezone\n\n    Set-ArubaCXSystem -timezone Europe/Paris\n\n    [...]\n    timezone                                        : Europe/Paris\n    [...]\n\n#Set a setting don't have (yet) parameter (usb_disable)\n\n    $system = Get-ArubaCXSystem -selector writable\n    $system.usb_disable = $true\n    $system | Set-ArubaCXSystem -use_pipeline\n\n    [...]\n    usb_disable                                     : True\n    [...]\n```\n### Users\nYou can get Users (local account) of Aruba CX\n\n```powershell\n\n#Get ALL local user\n    Get-ArubaCXUsers\n\n    admin\n    -----\n    /rest/v10.09/system/users/admin\n\n#Get info about admin local user\n\n    Get-ArubaCXUsers -user admin\n\n    authorized_keys :\n    name            : admin\n    origin          : built-in\n    password        : AQBapU0TkclkN5abVvBfWakRLdEwQAuF4jP3oqWRlwxj4avqYgAAAFw0UPMjwXH1xvCD00IaJ5YMo+OxvaA853gdPSu4cjkzvYlKIuQvQ52v6YH1wtxbBIU5nht+RMM2thytQZO7PNut4PNFnNwUP22h0Aq16IdEy2Oc2ma0csZ00l+TaGa4o8Ja\n    user_group      : @{administrators=/rest/v10.09/system/user_groups/administrators}\n\n```\n\n### VRF\n\nYou can create a new VRF `Add-ArubaCXVrfs`, retrieve its information `Get-ArubaCXVrfs`, modify its properties `Set-ArubaCXVrfs`, or delete it `Remove-ArubaCXVrfs`.\n\n```powershell\n\n# Create a vrf\n    Add-ArubaCXVrfs -name blue\n\n    [...]\n    https_server                            :\n    [...]\n    name                                    : blue\n    [...]\n    rd                                      :\n    [...]\n    snmp_enable                             : False\n    [...]\n    source_interface                        :\n    source_ip                               :\n    ssh_enable                              :\n    [...]\n\n# Get information about a vrf\n    Get-ArubaCXvrfs -name blue -attributes name, https_server, rd, ssh_enable, snmp_enable\n\n    https_server :\n    name         : blue\n    rd           :\n    snmp_enable  : False\n    ssh_enable   :\n\n# Change settings of a vrf (rd, snmp, ssh, https)\n    Get-ArubaCXVrfs blue | Set-ArubaCXVrfs -ssh_enable -https_server -snmp_enable -rd 11:22\n\n    [...]\n    https_server                            : @{enable=True}\n    [...]\n    name                                    : blue\n    [...]\n    rd                                      : 11:22\n    [...]\n    snmp_enable                             : True\n    [...]\n    source_interface                        :\n    source_ip                               :\n    ssh_enable                              : True\n    [...]\n\n# Remove a vrf\n    Get-ArubaCXVrfs blue | Remove-ArubaCXVrfs\n\n    Confirm\n    Are you sure you want to perform this action?\n    Performing the operation \"Remove Vrf blue\" on target \"Vrf\".\n    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is \"Y\"): Y\n```\n\n### VM\n\nYou can use PowerArubaCX for help to deploy Aruba CX OVA on VMware ESXi (With a vCenter)\nYou need to have [VMware.PowerCLI](https://developer.vmware.com/powercli) and [Set-VMKeystrokes](https://www.powershellgallery.com/packages/VMKeystrokes/1.0.0) from [William Lam](https://williamlam.com/2017/09/automating-vm-keystrokes-using-the-vsphere-api-powercli.html)\n\nYou can use the following cmdlet (on this order)\n\n- `Deploy-ArubaCXVm` Deploy CPPM OVA with add hard disk\n- `Set-ArubaCXVMFirstBootPassword` Configure first boot (Password...)\n- `Set-ArubaCXVMMgmtOobm` Configure OOBM Interface (ip, default-gateway)\n\n### MultiConnection\n\nFrom release 0.4.0, it is possible to connect on same times to multi Aruba CX\nYou need to use -connection parameter to cmdlet\n\nFor example to get system of 2 ArubaCX\n\n```powershell\n# Connect to first ArubaCX\n    $cx1 = Connect-ArubaCX 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false\n\n#DefaultConnection set to false is not mandatory but only don't set the connection info on global variable\n\n# Connect to second ArubaCX\n    $cx2 = Connect-ArubaCX 192.0.2.2 -SkipCertificateCheck -DefaultConnection:$false\n\n    # Get System hostname and mgmt  interface for first ArubaCX Switch\n    Get-ArubaCXSystem -attributes mgmt_intf, hostname -connection $cx1\n\n    hostname             mgmt_intf\n    --------             ---------\n    PowerArubaCX-Switch1 @{admin_state=up; default_gateway=10.200.11.254; dns_server_1=10.200.11.254; dns_server_2=0.0.0.0; ip=10.200.11.1; mode=static;\n\n# Get Interface for second ArubaCX Switch\n    Get-ArubaCXSystem -attributes mgmt_intf, hostname -connection $cx2\n\n    hostname             mgmt_intf\n    --------             ---------\n    PowerArubaCX-Switch2 @{admin_state=up; default_gateway=10.200.11.254; dns_server_1=10.200.11.254; dns_server_2=0.0.0.0; ip=10.200.11.2; mode=static;\n\n#Each cmdlet can use -connection parameter\n\n```\n\n### Disconnecting\n\n```powershell\n# Disconnect from the Aruba CX Switch\n    Disconnect-ArubaCX\n```\n\n# List of available command\n```powershell\nAdd-ArubaCXEvpnVlans\nAdd-ArubaCXInterfaces\nAdd-ArubaCXInterfacesLagInterfaces\nAdd-ArubaCXInterfacesVlanTrunks\nAdd-ArubaCXVlans\nAdd-ArubaCXVrfs\nConfirm-ArubaCXInterfaces\nConfirm-ArubaCXSystem\nConfirm-ArubaCXVlans\nConfirm-ArubaCXVrfs\nConnect-ArubaCX\nDeploy-ArubaCXVm\nDisconnect-ArubaCX\nGet-ArubaCXFirmware\nGet-ArubaCXInterfaces\nGet-ArubaCXLLDPNeighbor\nGet-ArubaCXSystem\nGet-ArubaCXUsers\nGet-ArubaCXVlans\nGet-ArubaCXVrfs\nInvoke-ArubaCXRestMethod\nRemove-ArubaCXInterfaces\nRemove-ArubaCXInterfacesLagInterfaces\nRemove-ArubaCXInterfacesVlanTrunks\nRemove-ArubaCXVlans\nRemove-ArubaCXVrfs\nSet-ArubaCXCipherSSL\nSet-ArubaCXInterfaces\nSet-ArubaCXSystem\nSet-ArubaCXuntrustedSSL\nSet-ArubaCXVlans\nSet-ArubaCXVMFirstBootPassword\nSet-ArubaCXVMMgmtOobm\nSet-ArubaCXVrfs\nShow-ArubaCXException\n```\n\n# Author\n\n**Alexis La Goutte**\n- \u003chttps://github.com/alagoutte\u003e\n- \u003chttps://twitter.com/alagoutte\u003e\n\n# Special Thanks\n\n- Warren F. for his [blog post](http://ramblingcookiemonster.github.io/Building-A-PowerShell-Module/) 'Building a Powershell module'\n- Erwan Quelin for help about Powershell\n\n# License\n\nCopyright 2018-2022 Alexis La Goutte and the community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoweraruba%2Fpowerarubacx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoweraruba%2Fpowerarubacx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoweraruba%2Fpowerarubacx/lists"}