Backing up Microsoft Lync 2013 is typically accomplished through the use of several PowerShell commands. These commands can be combined into a single PowerShell script and run nightly as a scheduled task. The individual commands are documented and can
be found within the TechNet library and are referenced below. Pre-built backup scripts can also be found within the TechNet Gallery. This article focuses specifically on the backup and restoration of user data.
User data can be backed up through the use of the export-csuserdata command. This command exports all user data for a pool into a pair of XML documents within a zipped archive. In order to get a complete backup of all user data, this command will need to
be run at least once for each pool in your organization. The command can be run as seen below to export all user data at once, or can be run with the –UserFilter parameter to backup only the user data for a single user.
Export-CsUserData -PoolFqdn “atl-cs-001.litwareinc.com” -FileName “C:\Logs\ExportedUserData.zip”
Export-CsUserData -PoolFqdn “atl-cs-001.litwareinc.com” -FileName “C:\Logs\ExportedUserData.zip” -UserFilter email@example.com
There are two closely related PowerShell commands that can be used for the importing of user data, Import-CSUserData and Update-CSUserData. Both have the ability to restore user data for a single user, or all users of a pool, but beyond that they have distinct
Import-CSUserData is used when you need to completely overwrite the user data with the copy from the backup. It is important to note that after this command it run, the user will not see the effect of the change until the Front End service on all servers
within the pool has been restarted.
Import-CsUserData -PoolFqdn “atl-cs-001.litwareinc.com” -FileName “C:\Logs\ExportedUserData.zip”
Import-CsUserData -PoolFqdn “atl-cs-001.litwareinc.com” ” -FileName “C:\Logs\ExportedUserData.zip” -UserFilter firstname.lastname@example.org
This command is used when the data from the backup needs to be merged with the existing data in the pool. Unlike Import-CSUserData, this command does not require any service restarts to be effective, however it should be noted that due to the merging it
is more resource intensive which can result in delays when the operation is performed for many users at once.
Update-CsUserData -Filename “C:\Logs\ExportedUserData.zip”
Update-CsUserData -Filename “C:\Logs\ExportedUserData.zip” -UserFilter “email@example.com”
- http://technet.microsoft.com/en-us/library/hh202182.aspx – Backing Up Lync Server
- http://technet.microsoft.com/en-us/library/hh202170.aspx – Backing up core data and settings
- http://technet.microsoft.com/en-us/library/jj204897.aspx – Export CSUserData
- http://technet.microsoft.com/en-us/library/jj205373.aspx – Import-CSUserData
- http://technet.microsoft.com/en-us/library/jj205358.aspx – Update-CSUserDAta
This is a cross post for some content I made for the TechNet Wiki: http://social.technet.microsoft.com/wiki/contents/articles/25001.backing-up-and-restoring-lync-2013-contacts.aspx