Remove Content from Lync 2013 Persistent Chat Room

This is a really common question which in previous versions was seemingly impossible unless you knew SQL really well. Well in Lync Server 2013 it’s a very different story and you can now use PowerShell to remove content from a room. I am just now waiting for someone to write a scheduled script to run this command with the right date set. If someone has something like this already written please let me know if your willing to share.

Extracts from TechNet:


Removes all the content from a Persistent Chat chat room beginning with the oldest item in the room and continuing through the specified end date. This cmdlet was introduced in Lync Server 2013.



  1. Thanks for the article. The script to auto-delete content after a certain time period would be an easy one, it's just one line! You can run this as a daily scheduled task to delete all content older than 90 days from all rooms:
    Get-CsPersistentChatRoom | Clear-CsPersistentChatRoom -EndDate ([DateTime]::today.AddDays(-90)) -Confirm:$false

    1. Thanks for the command help. I am not a PowerShell guru so community help is always appreciated.

  2. Awesome. Thanks for this. :)


Note: Only a member of this blog may post a comment.