Giter Site home page Giter Site logo

poweraruba / powerarubasw Goto Github PK

View Code? Open in Web Editor NEW
42.0 8.0 10.0 657 KB

PowerShell module to manage ArubaOS switches

License: Apache License 2.0

PowerShell 100.00%
powershell-module api-rest cmdlets networking hpe aruba arubaos powershell switch aruba-switch

powerarubasw's People

Contributors

alagoutte avatar benper44 avatar cedricmoreau avatar oitptobbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerarubasw's Issues

Connection Error

Hi,

I'm getting the error when connecting. ARUBA Model 6200F. What can i do?

PSARUBA Error

Unable to connect

Got some weird Issues with Connection.

Can connect to the switch.
But when I want to connect again with the same Creds after some Minutes it just says "Unable to connect"
After w8ing for 1 Day it works again for some time
Any Ideas?

Bulk Editing Aruba Switches

Hello,
this is a really nice module, but it would be even nicer if it is possible to edit multiple switches at the same time.
for example:

Adding new vlan to every switch is currently very time wasting (connecting to each switch and adding the vlan)

Solution:
$sw1 = ...
$sw2
$sw3
$sw4
....

Add-ArubaSWVlan -bulk ....

Is it possible?

Add function PoE

Hi,

Do you think it's possible to add in the next release a way to get the statut of the PoE on a port (enable or disable) ?

Thank you,

Nicolas Wybaux

Updating Firmware

Hello everyone,

so it seems there is only a Get-Firmware funktion. What about Post? I was trying to upload it myself with invoke-restmethod but that seems slow and also runs into a timeout (tineout defined by the switch, it doesn't matter if I set the timeout in Powershell myself)
So I was wondering: Is there a plan to implement Post? Or is it simply not possible to speed up the connection?

Add support of multi connection (to different switches)

It is not possible to have multi connection to different switches

The idea is connect to different switches
`
$sw1 = Connect-ArubaSW 10.xx.xx.1
$sw2 = Connect-ArubaSW 10.xx.xx.2

$vlan_sw1 = Get-ArubaSWVlans -connection $sw1
$vlan_sw2 = Get-ArubaSWVlans -connection $sw2
`

-force the "Disconnect-ArubaSW"

Hello,
i am wondering if its possible to force to "Disconnect-ArubaSW". For now it always aks if i really want to close the session...

thansk!

Add support of multi release API

There is multiple API release following firmware, the project start with APIv4 (16.05.xxxx)

need to add a option to specify API when connect and when launch query

Unable to connect with firmware 16.10 on PowerShell 5.0

Hi,

When I try to connect to different switches on firmware 16.10.0010 It's not working as expected. It's fully working on switches using older firmware than 16.10

I try the following lines:

$mysecpassword = ConvertTo-SecureString XXXX -AsPlainText -Force
Connect-ArubaSW  XXXXX -httpOnly -Username XXXX -Password $mysecpassword

I get the following error message

Unable to connect

On character XXXXXXXXXX\Public\Connection.ps1:142  :13

Throw "Unable to connect"

+CategoryInfo: Operation Stopped: (Unable to connect: String) [], RuntimeException

+FullyQualifiedErrorId: Unable to connect)

Regards,

Nicolas

Error on 54xxR-zl2 switch

Hi,
I get a small issue when I try a Get-ArubaSWSystemStatus on a 54xxR-zl2
They are uptodate and I try on some of them.

I get the following error :

PS H:\> Get-ArubaSWSystemStatus
Unable to use this cmdlet, you need to use Get-ArubaSWSystemStatusGlobal
Au caractère H:\Users\nw\Documents\WindowsPowerShell\Modules\PowerArubaSW\0.7\Public\System.ps1:117 : 13
+             Throw "Unable to use this cmdlet, you need to use Get-Aru ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to use t...temStatusGlobal:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to use this cmdlet, you need to use Get-ArubaSWSystemStatusGlobal
 

PS H:\> Get-ArubaSWSystemStatusGlobal
Unable to use this cmdlet, you need to use Get-ArubaSWSystemStatus
Au caractère H:\Users\nw\Documents\WindowsPowerShell\Modules\PowerArubaSW\0.7\Public\System.ps1:181 : 13
+             Throw "Unable to use this cmdlet, you need to use Get-Aru ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to use t...aSWSystemStatus:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to use this cmdlet, you need to use Get-ArubaSWSystemStatus

Any idea how to solve that issue ?

Regards

Add -usebasicparsing for Powershell 5

If using with Powershell 5 and not logged in Session (via Task Scheduler or other Software Service) -usebasicparsing has to be added to the invoke-webrequest Command

uploading config via tftp

hi
when i try to upload a config file via tftp and the get-arubaswcli i get an error "The copy commands are not supported via REST interface"
is there a way to upload a config file this way?

thanks!

Can't connect to a switch using HTTPS when use Powershell 6 (Core)

There is the following error :

PS /home/alagoutte/PowerArubaSW/Tests/integration> connect-arubaSW 10.44.23.213
PowerShell credential request
Please enter administrative credentials for your ArubaOS Switch
User: admin
Password for user admin: ***

Add-Type : (3,40): error CS0246: The type or namespace name 'ICertificatePolicy' could not be found (are you missing a using directive or an assembly reference?)
    public class TrustAllCertsPolicy : ICertificatePolicy {
                                       ^
At /home/alagoutte/PowerArubaSW/PowerArubaSW/Private/SSL.ps1:9 char:3
+   Add-Type -TypeDefinition @"
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData: ((3,40): error C...bly reference?):CSDiagnostic) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : Cannot add type. Compilation errors occurred.
At /home/alagoutte/PowerArubaSW/PowerArubaSW/Private/SSL.ps1:9 char:3
+   Add-Type -TypeDefinition @"
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException
+ FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand

New-Object : Cannot find type [TrustAllCertsPolicy]: verify that the assembly containing this type is loaded.
At /home/alagoutte/PowerArubaSW/PowerArubaSW/Private/SSL.ps1:21 char:55
+ ... anager]::CertificatePolicy = New-Object -TypeName TrustAllCertsPolicy
+                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

Unable to connect
At /home/alagoutte/PowerArubaSW/PowerArubaSW/Public/Connection.ps1:102 char:13
+             throw "Unable to connect"
+             ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Unable to connect:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to connect

InvalidOperation warning when get a exception with PowerShell 6 (Core)

if you use PowerShell 6 (Core) and get a "API" exception, there is a extra warning about no method GetReponseStream

PS C:\Users\alagoutte> Set-ArubaSWVlansPorts -vlan_id 85 -port_id 8 -port_mode untagged
Show-ArubaSWWebRequestException : Method invocation failed because [System.Net.Http.HttpResponseMessage] does not contain a method named 'GetResponseStream'.
At C:\Users\alagoutte\Documents\PowerShell\Modules\PowerArubaSW\0.6\Private\Webrequest.ps1:73 char:13
+             Show-ArubaSWWebRequestException -Exception $_
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [Show-ArubaSWWebRequestException], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound,Show-ArubaSWWebRequestException

ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\alagoutte\Documents\PowerShell\Modules\PowerArubaSW\0.6\Public\Vlans-Ports.ps1:181 char:46
+         $rep_vlanport = ($response.Content | convertfrom-json)
+                                              ~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

Unable connect

When I try to make the initial connection I am getting a simple 'Unable to connect' error on multiple switches

Code tried

Connect-ArubaSW 10.35.97.43
Connect-ArubaSW 10.35.97.49 -SkipCertificateCheck
Connect-ArubaSW -httpOnly 10.35.97.49 -SkipCertificateCheck

Error tossed
Unable to connect
At \leg\is\home\StrawG\WindowsPowerShell\Modules\PowerArubaSW\0.8.0\Public\Connection.ps1:142 char:13

  •         throw "Unable to connect"
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Unable to connect:String) [], RuntimeException
    • FullyQualifiedErrorId : Unable to connect

Version:
ModuleType Version Name ExportedCommands


Script 0.8.0 PowerArubaSW {Add-ArubaSWLACP, Add-ArubaSWTrunk, Add-ArubaSWVlans, Add-ArubaSWVlansPorts...}

Settings:

Web Management - Server Configuration

HTTP Access : Enabled
HTTPS Access : Enabled
SSL Port : 443
Idle Timeout : 600 seconds
Management URL : http://h17007.www1.hpe.com/device_help
Support URL : http://www.arubanetworks.com/products/networking/
User Interface : Improved
Listen Mode : data

Problem with connect to a switch

Hi,

i try to connect to a switch and get the following error message.

$mysecpassword = ConvertTo-SecureString secretpassword -AsPlainText -Verbose -force
PS C:\WINDOWS\system32> Connect-ArubaSW -httpOnly -Server 11.155.245.123 -Username manager -Password $mysecpassword
WARNUNG: The Switch API sends an error message:
WARNUNG: Error description (code): Not Found (404)
WARNUNG: Error details: {
"message": "Error 404: Not Found."
}
Unable to use switch API
In C:\Program Files\WindowsPowerShell\Modules\PowerArubaSW\0.6\Private\Webrequest.ps1:74 Zeichen:13
+             throw "Unable to use switch API"
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to use switch API:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to use switch API

Can you help me ?

Thanks

Some tests don't work on VSF switch

Following test don't work on VSF Switch about
Wrong port : check port 1 but with VSF it is port 1/1 (or A/1 for 5406zl)
Wrong "check" : get multiple result for a cmdlet (like led locator...)

  • Led
  • Port
  • Vlans-Ports
  • System (See #35)

Wrong welcome message when connect to a stacked Switch

When you connect to a stacked Switch (5406-VSF), we get

PS C:\Windows\system32> connect-arubasw 10.40.40.40 -httpOnly
Welcome on 5406-VSF - HPSwitch 5406Rzl2(J9850A), , , , , , HPSwitch 5406Rzl2(J9850A), , , , ,

Need to remove extra comma

hp 1820/1920 error Connect-ArubaSW

i have an old aruba switches
hp 1820
HPE 1920

with the latest firmeware - HPE OfficeConnect Switch 1820 48G J9981A, PT.02.11
cant connect them in powershell "
Connect-ArubaSW 192.168.2.238 -Username $username -Password $password #-SkipCertificateCheck

i get this error:

WARNING: The Switch API sends an error message:
WARNING: Error description (code): Not Found (404)
WARNING: Error details:

Not Found

HTTP/1.1 404The requested resource is not available.
someone to help ?

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.