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 lyncse01.ucmart.co.uk\SalesCategory

Next Add Members

Set-CsPersistentChatCategory -identity SalesCategory -AllowedMembers @{Add=”sip:user1@ucmart.co.uk”,”sip:user2@ucmart.co.uk”}

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=”sip:user1@ucmart.co.uk”}

Rooms

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=”sip:martinb@ucmart.co.uk”} -Managers @{Add=”sip:user1@ucmart.co.uk”}

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 “sip:user1@ucmart.co.uk”

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