Topic Last Modified: 2010-10-01

Enables you to export records that have been stored in the Microsoft Lync Server 2010 Archiving database.

Syntax

Export-CsArchivingData -DBInstance <String> -OutputFolder <String> -StartDate <DateTime> [-Confirm [<SwitchParameter>]] [-EndDate <DateTime>] [-IncludeTrustedApplication <SwitchParameter>] [-Purge <SwitchParameter>] [-UserUri <String>] [-WhatIf [<SwitchParameter>]]
Export-CsArchivingData -DBInstance <String> -OutputFolder <String> -StartDate <DateTime> [-Confirm [<SwitchParameter>]] [-EndDate <DateTime>] [-ExcludeWebConfArchive <SwitchParameter>] [-IncludeTrustedApplication <SwitchParameter>] [-UserUri <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

DBInstance

Required

String

Path to the SQL Server database instance where archiving data is recorded. For example: "atl-sql-001\Archinst".

OutputFolder

Required

String

Full path to the folder where the exported data should be stored (for example, C:\ArchivingExports). If this folder does not exist, then Export-CsArchivingData will create it.

StartDate

Required

DateTime

Indicates the earliest activity date for the records to be exported. For example, if you set the start date to 6/1/2010 (June 1, 2010, in U.S. English) any items recorded in the database prior to that date (for example, items recorded on May 31, 2010) will be excluded from the export.

Use the date-time formats specified by your Regional and Language Options settings when assigning values to the StartDate and EndDate properties.

EndDate

Optional

DateTime

Indicates the latest activity date for records to be exported. For example, if you set the end date to 6/1/2010 (June 1, 2010, in U.S. English) any items recorded in the database after that date (for example, items recorded on June 2, 2010) will be excluded from the export. Although you will not receive an error message, your export will fail if the end date occurs before the start date (for example, an end date of 1/1/2010 and a start date of 6/1/2010).

Use the date-time formats specified by your Regional and Language Options settings when assigning values to the StartDate and EndDate properties.

If an end date is not specified then the current date will be used.

UserUri

Optional

String

Enables you to export archiving data for a single user; this is done by using the UserUri parameter and specifying the SIP address of the user. The UserUri parameter will accept only one URI at a time.

ExcludeWebConfArchive

Optional

Switch Parameter

Instructs Export-CsArchivingData to only export instant messaging records. By default, the cmdlet exports both IM and conferencing records.

Purge

Optional

Switch Parameter

When included, the Purge parameter causes any record that has been successfully exported to be deleted from the Archiving database. If you do not include this parameter, exported records will be retained in the database.

WhatIf

Optional

Switch Parameter

Describes what would happen if you executed the command without actually executing the command.

Confirm

Optional

Switch Parameter

Prompts you for confirmation before executing the command.

Detailed Description

Many organizations find it useful to keep a transcript of all the instant messaging (IM) sessions carried out by their users. Other organizations find it mandatory to keep such transcripts. For example, organizations in the financial world are often required by law to keep copies of all their electronic communications.

Regardless of the reason, Lync Server 2010 gives you flexibility when it comes to archiving IM and conferencing sessions. If you have deployed Archiving Server, you can use the various CsArchivingConfiguration cmdlets to enable and disable instant message archiving and to manage your Archiving database. You can also suspend IM should archiving fail, which helps ensure that you keep a record of all your electronic communications.

If you have enabled archiving, records of your users’ electronic communications are stored in the Archiving database. If you would like to view all of these records (or a selected subset of these records), you can use the Export-CsArchivingData cmdlet to extract these records from the database and save them as an Outlook Express Electronic Mail (EML) file (.EML file extension).

Who can run this cmdlet: By default, members of the following groups are authorized to run the Export-CsArchivingData cmdlet locally: RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Export-CsArchivingData"}

Input Types

None. Export-CsArchivingData does not accept pipelined input.

Return Types

Export-CsArchivingData returns Archiving database records in EML format.

Example

-------------------------- Example 1 ------------------------

Copy Code
Export-CsArchivingData -DBInstance atl-sql-001\Archinst -StartDate 1/1/2010 -OutputFolder "C:\ArchivingExports"

The command shown in Example 1 extracts records from the Archiving database atl-sql-001\Archinst, and then saves the resulting EML file to the folder C:\ArchivingExports. The specified start date of January 1, 2010 (-StartDate 1/1/2010) ensures that only items recorded in the database after 12/31/2009 will be exported.

-------------------------- Example 2 ------------------------

Copy Code
Export-CsArchivingData -DBInstance atl-sql-001\Archinst -StartDate 1/1/2010 -OutputFolder "C:\ArchivingExports" -UserUri "sip:kenmyer@litwareinc.com"

The preceding command is a variation of the command shown in Example 1; in this case, however, only the records pertaining to the user Ken Myer are exported. To limit your export to records pertaining to a single user, include the UserUri parameter followed by appropriate SIP address.

-------------------------- Example 3 ------------------------

Copy Code
Export-CsArchivingData -DBInstance atl-sql-001\Archinst -StartDate 1/1/2010 -EndDate 1/31/2010 -OutputFolder "C:\ArchivingExports"

Example 3 represents another variation of the command shown in Example 1. In Example 3, however, only items recorded in the database during the month of January 2010 are exported. To limit exporting to this time interval, the EndDate parameter is included along with the StartDate parameter. With a start date of January 1, 2010 and an end date of January 31, 2010, exporting is limited to items recorded during January 2010.

See Also