Using PowerShell 3.0+ you can backup Ribbon (previously Sonus) SBC1000 and SBC2000 SBC’s using the REST API.
Firstly, you will need to create a user with ‘rest’ level user permissions on the SBC:
You can learn more about creating the user account here.
Then simply run the script in PowerShell, or setup a scheduled task to automate the process. Follow the script setup info within the script e.g:
Download
Download here on GitHub
Hi Andrew!
Thanks a lot for your quick update! I truly appreciate it.
Just a quick inquiry, when i tried to run my script, i got the “404 – Not found error” on my Invoke-RestMethod.
When i tried to access the URL https://ServerName/rest/login in a browser. It only showed “405”
I’m really sorry but i’m just a newbie with REST API in RIBBON, is there something i’m missing? Is there something i need to enable on the SBC for the REST API to push through?
Thanks in advance!
No problem! I’ve sent you an email. Send me the PS output and settings and I’ll take a look.
Thanks a lot for this Andrew! It’s a great help! This new script worked for me.
sorry ignore the comment
this is the error
Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel.
At line:68 char:5
+ Invoke-RestMethod -Uri $LoginUrl -Method Post -Body $LoginCredentials -Sessi …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel.
At line:73 char:5
+ Invoke-RestMethod -Uri $BackupUrl -Method POST -Body $args -WebSession $ps – …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
I think it could be a TLS issue. Try uncommenting line 69 or 70 starting with [Net.ServicePointManager]::
Hi Andrew
Please could you help
When I tried to run the script, I am getting ‘unable to connect to the remote server. Also when i tried to browse https://X.X.X.X/rest/login, it returns 405.
I made an update – line 66: [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Try download the new version and see if it fixes it.