Wednesday, October 29, 2014

Backup script for Lync 2013 v3_5 released

As a preparation for the upcoming "Lync Server 2013 Cookbook" and my sessions at Norwegian Lync Day 2014 and TechED 2014, I have taken a hard look at my Lync server 2013 backup script and published a new version.

The 3.5 version of the script was published on Sunday the 26th of October, and has been changed a lot. There's not much left from my original backup script for the 2010 server, but that is a good thing. I believe this was one of my first scripts, and it was not very well written. it did is job, but the code could surely be improved.

I've come a long way since then, and hopefully the script now has better error handling and more efficient ways of doing the job.

The update contains some bugfixes, better error handling and a couple of new features. Some of the highlights are: Removing a lot of "red text" when errors occur. Not all errors are errors you should worry about, and those are the ones i have tried to catch.

The biggest change within the script has been made to the SQL backup. It used to make a backup of the entire instance (by using get-childitem and running a foreach loop). It has now been split into categories (which in turn can be skipped) and will only target named databases for the required function.

Example: When the script executes the backup of the monitoring database, it will only look for the LcsCdr and QoEMetrics databases.

To skip a task like backup of these databases, run the script with -SkipMonDB switch, like this:

.\Backup-Lync2013.ps1 -SkipMonDB

I have also added a "-DebugSQL" switch which has been handy when trying to figure out what is happening and where. The only function of this switch is to write a lot of info to the screen. Information like "This is a Lync 2010 server, or this is a SQL 2008 server". If anyone rin into issues with sql when running the script, and you want to report it to me, please use this switch so I can know a little more about the environment when answering your questions. Or try changing the code to catch the problem.

To see the complete list of features, please visit the script download site for details.