Remove-CsDiagnosticConfiguration

 

Topic Last Modified: 2012-03-25

Removes one or more of the diagnostic configuration settings collections currently in use in your organization. Diagnostic configuration settings are used to determine whether traffic to or from a given domain or Uniform Resource Identifier (URI) is recorded in your Microsoft Lync Server 2010 log files.

Syntax

Remove-CsDiagnosticConfiguration -Identity <XdsIdentity> [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Detailed Description

If you enable logging for Lync Server 2010, then, by default, traffic traveling to or from any domain or URI is included in those log files. This ensures that as much information as possible is recorded in the log files.

However, this can occasionally result in too much information. For example, if you are experiencing connectivity problems with a particular domain, you might want to limit logging to traffic between your network and that domain; that makes it easier for you to identify the relevant records and, in turn, might make it easier for you to diagnose and correct the problem.

Diagnostic configuration settings make it possible for you to specify the domains or URIs that will be recorded in the log files; if a diagnostic filter is enabled then only traffic to or from the specified domains will be logged. Lync Server enables you to create diagnostic configuration settings, and apply diagnostic filters, at the site scope. In turn, this enables you to apply filtering to, say, the Redmond site while leaving filtering disabled on your other sites.

You can use the Remove-CsDiagnosticConfiguration cmdlet to remove any of the diagnostic configuration settings you have created at the site scope. The Remove-CsDiagnosticConfiguration cmdlet can also be run against the global diagnostic configuration settings. In that case, however, the collection will not be deleted; that’s because Lync Server does not allow you to delete global collections. Instead, removing a global collection causes the properties in that collection to be reset to their default values. That means that all the filters added to that collection will be removed.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Remove-CsDiagnosticConfiguration cmdlet: 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 "Remove-CsDiagnosticConfiguration"}

Parameters

Parameter Required Type Description

Identity

Required

Xds Identity

Unique identifier for the diagnostic configuration settings to be removed. To remove settings configured at the site scope, use syntax similar to this: -Identity "site:Redmond".

Remove-CsDiagnosticConfiguration can also be run against the global configuration settings; in that case, use this syntax: –Identity global. However, the global settings will not actually be removed; instead, the properties found in the global settings will be reset to their default values.

Force

Optional

Switch Parameter

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

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.

Input Types

Microsoft.Rtc.Management.WritableConfig.Settings.Diagnostics.DiagnosticFilterSettings object. Remove-CsDiagnosticConfiguration accepts pipelined instances of the diagnostic filter settings object.

Return Types

None. Instead, Remove-CsDiagnosticConfiguration deletes existing instances of the Microsoft.Rtc.Management.WritableConfig.Settings.Diagnostics.DiagnosticFilterSettings object.

Example

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

Remove-CsDiagnosticConfiguration -Identity site:Redmond

The preceding command deletes the diagnostic configuration settings that have the Identity site:Redmond.

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

Get-CsDiagnosticConfiguration -Filter site:* | Remove-CsDiagnosticConfiguration

The command shown in Example 2 deletes all the diagnostic configuration settings that have been configured at the site scope. To do this, the command calls Get-CsDiagnosticConfiguration along with the Filter parameter; the filter value "site:*" limits the returned data to settings where the Identity begins with the characters "site:". The filtered collection is then piped to Remove-CsDiagnosticConfiguration, which removes each item in that collection.

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

Get-CsDiagnosticConfiguration | Remove-CsDiagnosticConfiguration

In Example 3, the command deletes all the diagnostic configuration settings currently in use in the organization. To perform this task, Get-CsDiagnosticConfiguration is first called without any parameters in order to return a collection of all the diagnostic configuration settings currently in use in the organization. These items are then piped to the Remove-CsDiagnosticConfiguration, which removes each item in the collection.