Copy the below script and paste it into Notepad (or a Windows PowerShell editor) and save the file with the name Get-CsApplicationContact.ps1.
2. From a Microsoft Lync Front End server, open Lync Server Management Shell.
3. Navigate to the folder where the .ps1 file is located, and run the following command:
4. Run the following command to retrieve the list of Response Group contact objects associated with a specific pool (pool01.contoso.com in the example below):
Get-CsApplicationContact –OwnerUrn “urn:application:Rgs” –Filter “(MSRTCSIP-ApplicationOptions=1)” –RegistrarPool “lync-pool.test.local”
The OwnerUrn parameter specifies that you want only contacts for the Response Group application. The Filter parameter is an LDAP filter that will select only contact objects that have been at some point tied to a Response Group workflow, and unselect the two contact objects (Presence Watcher and Announcement Service) that are automatically created with Response Group application. The RegistrarPool parameter allows you to select only contacts associated with a specific pool.
5. The preceding command should output all the properties of every contact object formerly associated with a Response Group workflow on the specified pool. If you are satisfied with that list, you can delete those contact objects by simply re-running the same command and adding the Delete parameter at the end, like this:
Get-CsApplicationContact –OwnerUrn “urn:application:Rgs” –Filter “(MSRTCSIP-ApplicationOptions=1)” –RegistrarPool “lync-pool.test.local” –Delete
You’ll receive a confirmation prompt to delete each contact object, so that you can skip some of them if necessary.