I’ve been asked quite a few times in the past about how an administrator can export archived IM messages from a Lync Server archiving database and while I faintly have an idea of the PowerShell cmdlet used, I find that I can never remember exactly what it is and the syntax because I don’t use it enough so this post serves to demonstrate using the cmdlet.
The cmdlet we’re interested in using is Export-CsArchivingData and the documentation for it can be found here:
http://technet.microsoft.com/en-us/library/gg398452.aspx
The syntax is fairly straight forward as demonstrated in the documentation:
COMMON PARAMETERS: -OutputFolder <String> -StartDate <DateTime> [-Confirm [<SwitchParameter>]] [-EndDate <DateTime>] [-ExcludeWebConfArchive <SwitchParameter>] [-Force <SwitchParameter>] [-IncludeTrustedApplication <SwitchParameter>] [-Purge <SwitchParameter>] [-UserUri <String>] [-WhatIf [<SwitchParameter>]]
The following example demonstrates exporting messages for a specific user with the start date of February 5, 2013:
Export-CsArchivingData -Identity "ArchivingDatabase:svrsqlmon01.domain.internal" -StartDate 2/5/2013 -OutputFolder "C:\ArchivingExports" -UserUri "sip:tluk@domain.com"
The default file format of the messages that the cmdlet exports is .eml but you can actually rename it to .mht and use Internet Explorer to open the file:
The following cmdlet exports all of the archived IMs with the start date of February 5, 2013:
Export-CsArchivingData -Identity "ArchivingDatabase:svrsqlmon01.domain.internal" -StartDate 2/5/2013 -OutputFolder "C:\ArchivingExports"
The following cmdlet exports all of the archived IMs with a start date of February 5, 2013 and end date of February 10, 2013:
Export-CsArchivingData -Identity "ArchivingDatabase:svrsqlmon01.domain.internal" -StartDate 2/5/2013 -EndDate 2/10/2013 -OutputFolder "C:\ArchivingExports"