Startseite » PowerShell to the Rescue: Mass-Backups needed

PowerShell to the Rescue: Mass-Backups needed

by enricojost

HI there,

So, I recently found myself in a situation where I needed to upgrade a bunch of AudioCodes SBCs, and doing a „mass-backup“ through OVOC (One Voice Operations Center) just wasn’t an option for a bunch of reasons. That’s when I decided to whip up a quick-and-dirty PowerShell script to handle the job for me. This little script takes a list of SBCs and does all the heavy lifting of backing up the INI and license files.

Here’s How the Script Works:

  1. Turning Off SSL/TLS Certificate Validation: The first thing the script does is turn off SSL/TLS certificate validation. This is handy when you’re dealing with devices using self-signed certificates. Just a heads-up—this step bypasses some security checks, so use it carefully.
  2. Importing Device Data from a CSV: The script reads from a CSV file (SBC.csv) that has all the info it needs—like the IP addresses, usernames, and passwords for the devices. This makes it super easy to run the script for multiple devices all at once.
  3. Setting Up Authentication: For each device, the script builds an authentication header by encoding the username and password. This is necessary to log in and get access to the device’s data.
  4. Sending HTTP Requests: With authentication in place, the script sends HTTP GET requests to each device to grab the configuration and license info. The data gets saved locally, so you’ve got a backup of everything important.
  5. Saving the Backup and License Files: Finally, the script organizes the backups nicely, naming the files with the device’s IP address and the current date. This way, finding and auditing your backups is a breeze.

If you’re interested in checking it out, head over to my GitHub. You’ll find some notes on how to use it, an example CSV file, and the script itself. Here’s a sample output from one of my lab SBCs:

Cheers,

Enrico

You may also like