Persistent Chat Admin by Lync Management Shell

A day of Persistent Chat Management Shell

Today i was doing some P Chat and wanted to administrator it only via Lync Management Shell. This was for a single FE with collocated P Chat.

Create New Category

New-CsPersistentChatCategory -Name SalesCategory –Description Sales Category –EnableInvitations -EnableFileUpload

Remove Category

Remove-CsPersistentChatCategory -Name\SalesCategory

Next Add Members

Set-CsPersistentChatCategory -identity SalesCategory -AllowedMembers @{Add=””,””}

Or add Member using security group

Set-CsPersistentChatCategory -Identity ITS –AllowedMembers “CN=PChatAdmins,CN=Users,DC=domain,DC=co,DC=uk”

Define Creators

Set-CsPersistentChatCategory -Identity SalesCategory -Creators @{Add=””}


Create Chat Room and assign to Sales Category

New-CsPersistentChatRoom -Name Sales -Category SalesCategory –Description “Sales Chat Room”

Delete Room

Remove-CsPersistentChatRoom -Identity Sales

Add Members to room and assign manager

Set-CsPersistentChatRoom -identity Sales -Members @{Add=””} -Managers @{Add=””}

Clear Content from Room on or before 30/4/2015

Clear-CsPersistentChatRoom -Identity sales -EndDate “30/4/2015” –Verbose

Replaces one or more Persistent Chat messages in the Persistent Chat database with a default message or with an administrator-provided message.

Remove Message from Room by date

Remove-CsPersistentChatMessage -Identity sales -EndDate “30/4/2015” –Verbose

Remove Message from Room by user

Remove-CsPersistentChatMessage -Identity sales -UserUri “”

Remove Message by Filter

Remove-CsPersistentChatMessage -Identity sales -Filter “martin” –Verbose

Filter Message and Replace

Remove-CsPersistentChatMessage -Identity sales -Filter “dave” -ReplaceMessage “peter pan” –Verbose

Find disabled Rooms

Get-CsPersistentChatRoom -Disabled $true

Re-enable disabled Room

Set-CsPersistentChatRoom -Identity “Sales Room” -Disabled $false


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.