Thursday, May 7, 2015

More additions to the Backup-SfB script

The Backup-SfB script was just released, and keen eyes might have noticed the version 4.00 has been updated to 4.00 C by the time of the release.
I had several beta testers run the 4.00 release, and most of them ran it without too many comments. But I received two important requests:

  1. Please try to minimize error output from the script
  2. I don't know how to capture certain devices.
So here are the three minor, yet important changes to the script

Backup Common Area and Analog Devices
This request was simple enough: Neither the user nor the db backups hold any information on Common area phones or Analog devices. That's why the "backup-basics" function now will run get-cscommonarephone and get-csanalogphones and pipe it to a couple of csv files in the bakcup directory. 
From these files, it should be easy enough to import the information required back into SfB upon restore through a script.

CS Announcements
Although this information is present in the CMS configuration, I was asked if not this could be added as a standalone extra in the same way as the polices and voice settings are.
As it only took two lines of code, I decided it was a good idea to do so.
Included in the bakup are now two new files. A list of unassigned number ranges, and a list of cs announcements (The voice prompts should already be a part of the file backup)

Error handling
Error handling isn't my strongest powershell skill. After all, I'm only a UC techie trying to learn this stuff. But I have been requested on several occasions to quiet down the blood red text in the output of the script. In order to do so, I have now set the default error and warning handling to -silentlycontinue, unless you use the -DebugSQL switch.

I have tried to capture any missing backup files we would expect, so please read the transcript for errors. And then run the script again, with the -debugsql switch to capture the real error.