Skype for Business Server 2015

Topic Last Modified: 2017-03-28

Manually purges records from the Quality of Experience (QoE) database. This cmdlet was introduced in Lync Server 2013.

Invoke-CsQoEDatabasePurge -Identity <XdsIdentity> <COMMON PARAMETERS>

Invoke-CsQoEDatabasePurge -SqlServerFqdn <String> [-SqlInstanceName <String>] <COMMON PARAMETERS>

COMMON PARAMETERS: -PurgeQoEDataOlderThanDays <Int32> [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

The command shown in Example 1 purges all the QoE records more than 10 days old from the monitoring database on

Invoke-CsQoEDatabasePurge -Identity "" -PurgeQoEDataOlderThanDays 10

The command shown in Example 2 is a variation of the command shown in Example 1; in this case, however, the Confirm parameter is added using this syntax:


That syntax suppresses the confirmation prompts that would otherwise appear when purging QoE records.

Invoke-CsQoEDatabasePurge -Identity "" -PurgeQoEDataOlderThanDays 10 -Confirm:$False

Example 3 purges all the QoE records more than 10 days old from all monitoring QoE databases in use in the organization. To do this, the first command in the example uses the Get-CsService cmdlet and the MonitoringDatabase parameter to return a collection of all the monitoring databases. This collection is then piped to the ForEach-Object cmdlet. In turn, the ForEach-Object cmdlet takes each database in the collection and then runs the Invoke-CsQoEDatabasePurge cmdlet against that database, purging all the Quality of Experience records more than 10 days old.

Get-CsService -MonitoringDatabase | Invoke-CsQoEDatabasePurge -PurgeQoEDataOlderThanDays 10 -Confirm:$False

Quality of Experience (QoE) metrics track the quality of audio and video calls made in your organization, including such things as the number of network packets lost, background noise, and the amount of "jitter" (differences in packet delay). These metrics are stored in a database apart from other data (such as call detail records), which allows you to enable and disable QoE independent of other data recording.

Quality of Experience records are stored in the SQL Server database LcsQoEMetrics. Over time, this database has the potential to grow extremely large. Because of that, Lync Server provides two ways for administrators to purge older records from the database: 1) you can configure Skype for Business Server 2015 to automatically delete older QoE records each day; and/or, 2) you can use the Invoke-CsQoEDatabasePurge cmdlet at any time to delete Quality of Experience records from the LcsQoEMetrics database. (The Invoke-CsQoEDatabasePurge cmdlet does this by calling the SQL Server stored procedure QoePurgeOutdatedReports.)

When you call the Invoke-CsQoEDatabasePurge cmdlet you must specify the service location of the monitoring database where the QoE records are stored (for example,; you must also indicate the minimum age (in days) of the records to be deleted. For example, if you specify a minimum age of 10 days then all QoE records older than 10 days will be deleted from the database.

Note that these records will be deleted even if the purging has been disabled for the specified database. (That is, the EnablePurging property in the QoE configuration settings has been set to False.) The EnablePurging property only controls the automated purging of archiving records; it has no effect on the Invoke-CsQoEDatabasePurge cmdlet.

Skype for Business Server Control Panel: The functions carried out by the Invoke-CsQoEDatabasePurge cmdlet are not available in the Skype for Business Server Control Panel.


Parameter Required Type Description




Service Identity of the monitoring database to be purged. You can retrieve the Identities for your monitoring databases by running this command:

Get-CsService -MonitoringDatabase

Note that you cannot use the Identity parameter and the SqlServerFqdn parameter in the same command.




Specifies the age (in days) of the QoE records to be purged from the database; any records older than this value will be deleted.

PurgeQoEDataOlderThanHours can be set to any integer value between 1 and 2147483647, inclusive.




Fully qualified domain name of the computer where the QoE database is located. For example:

-SqlServerFqdn ""

Note that you cannot use the Identity parameter and the SqlServerFqdn parameter in the same command.




Prompts you for confirmation before executing the command.




Suppresses the display of any non-fatal error message that might occur when running the command.




SQL Server instance name for the QoE database. For example:

-SqlInstanceName "archinst"




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




PARAMVALUE: $true | $false

The Invoke-CsQoEDatabasePurge cmdlet accepts pipelined instances of the Microsoft.Rtc.Management.Xds.DisplayMonitoringDatabase#Decorated class.

The Invoke-CsQoEDatabasePurge cmdlet returns instances of the Microsoft.Rtc.Management.Purge.QoEDataPurgeStatistics class.