December 30 2010

Scheduled task Powershell script to backup Lync Server 2010 config

I’ve created a simple Powershell script to run daily to backup Lync configuration with the export-csconfiguration command:

cd $env:UserProfile
Import-Module 'C:Program FilesCommon FilesMicrosoft Lync Server 2010ModulesLyncLync.psd1'
$filename = "d:backup{0:yyyy.MM.dd-HH.mm}-config.zip" -f (Get-Date)
export-csconfiguration -Filename $filename -Force:$True

For example, put the above code into a document called d:backupbackup.ps1 and then create a scheduled task to execute the command on a daily basis:

powershell -command d:Backupbackup.ps1

This can run in the SYSTEM context. Simples!
 
 



----------------------------------------------------------------------------
I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.

----------------------------------------------------------------------------


Tags: , , , , , , ,

Posted December 30, 2010 by danovich in category "OCS / Lync", "Powershell

3 COMMENTS :

  1. By Korbyn on

    What about backing up the users contact lists? are those stored in SQL or in the CS Config?

    Reply
  2. By Adam on

    Hi- Do you have a PS script that can be scheduled as a task, and will export the archive (export-csarchivingdata)? Ideally, I would like to export the archive on a regular basis, automatically change the file extensions from *.eml to *.mht, then backup the output. But if I can figure out any part of this schenerio, I’d be happy.

    Reply

Leave a Reply