poweraruba / powerarubasw Goto Github PK
View Code? Open in Web Editor NEWPowerShell module to manage ArubaOS switches
License: Apache License 2.0
PowerShell module to manage ArubaOS switches
License: Apache License 2.0
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
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
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
The following cmdlets don't work with APIv4
Get-ArubaSWSystemStatusCpu
Get-ArubaSWSystemStatusMemory
Get-ArubaSWSystemStatusStorage
Get-ArubaSWSystemStatusTime
need to be remove !
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
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
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
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
Get-ArubaSWSystemStatus don't work on stacked/VSF switch (-> /rest/v4/system/status)
Need to use /rest/v4/system/status/global_info or /rest/v4/system/status/members
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
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!
Hi!
Just a note:
PS> get-arubaswpoe -connection $arubaswitch[0]
Get-ArubaSWPoE : A parameter cannot be found that matches parameter name 'connection'.
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?
PowerArubaSW currently doesn't provide a command that can do firmware uploads to HP/Aruba AOS-S switches.
The process for doing this using the REST API is described on the HPE website here:
https://support.hpe.com/hpesc/public/docDisplay?docId=sf000095706en_us&docLocale=en_US
It would be great if this could be added as this would be a step towards being able to script/schedule switch updates in bulk.
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
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?
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?
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!
the idea is add on the same cmdlet multiple vlan on a same port (or configure multiple port with same vlan ?)
the example cmdlet :
Add-ArubaSWVlansPorts -vlan_id 85,86 -port_id 8 -port_mode tagged
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
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"
~~~~~~~~~~~~~~~~~~~~~~~~~
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
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...)
Following module don't have test
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
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.