Edit

Share via


Remove-CsPersistentChatMessage

Replaces one or more Persistent Chat messages in the Persistent Chat database with a default message or with an administrator-provided message. This cmdlet was introduced in Lync Server 2013.

Syntax

Remove

Remove-CsPersistentChatMessage
    -Identity <String>
    [-Remove]
    [-CaseSensitive <Boolean>]
    [-Confirm]
    [-EndDate <DateTime>]
    [-Filter <String>]
    [-MatchClause <AndOr>]
    [-StartDate <DateTime>]
    [-UserUri <String>]
    [-WhatIf]
    [<CommonParameters>]

Replace

Remove-CsPersistentChatMessage
    -Identity <String>
    -ReplaceMessage <String>
    [-CaseSensitive <Boolean>]
    [-Confirm]
    [-EndDate <DateTime>]
    [-Filter <String>]
    [-MatchClause <AndOr>]
    [-StartDate <DateTime>]
    [-UserUri <String>]
    [-WhatIf]
    [<CommonParameters>]

Description

The Persistent Chat service (which replaces the Group Chat service used in Microsoft Lync Server 2010) provides organizations with messaging and collaboration capabilities similar to those found in Internet discussion forums: users can exchange messages in real-time, yet can also revisit and restart those conversations at any time. Conversations can be based around specific topics and these conversations can be made available to everyone or to only a selected set of users. Likewise, individual chat rooms can be configured so that anyone can post a message or configured so that only designated presenters can post messages.

Persistent Chat discussions take the form of messages posted in individual chat rooms; chat rooms are discussion forums based on specific topics. By design, messages posted in a chat room remain there forever; at any time, users can return to the room and review all the messages that have been previously posted.

However, there might be times when administrators need to remove messages from a chat room; for example, perhaps a user posted a series of messages with erroneous information regarding the forthcoming company meeting. The Remove-CsPersisentChatMessage cmdlet enables administrators to remove a single chat message, or to remove an entire set of chat messages based on criteria such as the user who posted the message or keywords found in that message.

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

Examples

Example 1

Remove-CsPersistentChatMessage -Identity "atl-persistentchat-001.litwareinc.com\ITChatRoom" -EndDate "4/1/2012"

The command shown in Example 1 removes all the Persistent Chat messages posted on or before April 1, 2012 from the ITChatRoom chat room on the server atl-persistentchat-001.litwareinc.com.

Example 2

Remove-CsPersistentChatMessage -Identity "atl-persistentchat-001.litwareinc.com\ITChatRoom" -UserUri "sip:kenmyer@litwareinc.com"

In Example 2, all Persistent Chat messages posted by the user kenmyer@litwareinc.com are removed from the ITChatRoom chat room on the server atl-persistentchat-001.litwareinc.com.

Parameters

-CaseSensitive

Applicable: Lync Server 2013, Skype for Business Server 2015

When present, indicates that case sensitivity should be used when searching for messages to be removed. (In other words, an uppercase "A" will be treated as a different character than a lowercase "a".) By default, searches are not case sensitive.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Applicable: Lync Server 2013, Skype for Business Server 2015

Prompts you for confirmation before executing the command.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndDate

Applicable: Lync Server 2013, Skype for Business Server 2015

Enables you to filter for messages that were posted on or before the specified date.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Filter

Applicable: Lync Server 2013, Skype for Business Server 2015

Keywords that can be used to help identify the messages to be deleted. For example, to search for all messages that include the keyword "Fabrikam" use this syntax:

-Filter "Fabrikam"

To search for multiple keywords, put all the keywords in a single string, separated by using blank spaces:

-Filter "Fabrikam Contoso TailspinToys"

By default, the Remove-CsPersistentChatMessage cmdlet will look for messages using all the specified keywords. To look for messages using any one of the provided keywords, use the MatchClause parameter and set the parameter value to "Or".

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

Applicable: Lync Server 2013, Skype for Business Server 2015

Unique identifier for the chat room containing the message to be deleted. For example:

-Identity "atl-persistentchat-001.litwareinc.com\ITChatRoom"

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MatchClause

Applicable: Lync Server 2013, Skype for Business Server 2015

Specifies how the Remove-CsPersistentChatMessage cmdlet handles multiple keywords. Allowed values are:

  • All (A message must include all the specified keywords in order to be a match)
  • Or (A message containing one or more of the specified keywords will be considered a match)
  • Exact (Messages must exactly match the specified phrase, including the word order, in order to be a match)

For example, this syntax searches for messages that have the exact phrase "For internal use only) in the message text:

-Filter "For internal use only" -MatchClause "Exact"

Parameter properties

Type:AndOr
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Remove

Applicable: Lync Server 2013, Skype for Business Server 2015

When present, removes the Persistent Chat message without leaving a replacement message.

You cannot use both the Remove parameter and the ReplaceMessage parameter in the same command.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Remove
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplaceMessage

Applicable: Lync Server 2013, Skype for Business Server 2015

Enables administrators to specify the text of the replacement message. By default, the replacement message reads "This message was replaced by the Persistent Chat administrator."

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Replace
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StartDate

Applicable: Lync Server 2013, Skype for Business Server 2015

Enables you to filter for messages that were posted on or after the specified date.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserUri

Applicable: Lync Server 2013, Skype for Business Server 2015

SIP address of the user who posted the message (or messages) that should be removed.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Applicable: Lync Server 2013, Skype for Business Server 2015

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

The Remove-CsPersistentChatMessage cmdlet does not accept pipelined input.

Outputs

None