Topic Last Modified: 2010-10-01

Deletes an existing Response Group queue. With the Response Group application, phone calls are put in a queue and callers are placed on hold until a Response Group agent is available to answer that call.


Remove-CsRgsQueue -Instance <Queue> [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]


Parameter Required Type Description



Rgs Identity

Unique identifier for the queue to be removed. The Identity of a Response Group queue consists of the location of the service where the queue is hosted plus a globally unique identifier (GUID). That means that a Response Group queue will have an Identity similar to this: Because GUIDs are difficult to remember and to work with, the Examples section of this topic demonstrates alternate ways that you can identify the queue to be removed.



Switch Parameter

Forces the deletion of a Response Group queue. If this parameter is present, the queue will be deleted without warning, even if the queue is assigned to an active workflow. If this parameter is not present then you will be asked to confirm the deletion of any queue currently in use by an active workflow.



Switch Parameter

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



Switch Parameter

Prompts you for confirmation before executing the command.

Detailed Description

When someone calls a phone number associated with the Response Group application one of two things typically happens: either the call is transferred to a question that the caller must answer in order to continue (for example, "Press 1 for hardware support; press 2 for software support") or the call is placed in a queue until a Response Group agent is available to answer the call.

Instead of having a single queue for all phone calls, the Response Group application enables you to create multiple queues that can be associated with different workflows and different Response Group agent groups. In turn, this means queues can respond differently to events such as a designated number of calls being simultaneously held in the queue, or to callers that have been on hold for specified amount of time.

In addition to creating new queues you can also remove existing queues; that’s what the Remove-CsRgsQueue cmdlet is for. Note that, by default, you will be prompted if you try to remove a queue that is currently assigned to an active workflow; the prompt will ask you to verify that you want to delete the queue, and Windows PowerShell will pause (and no queue will be deleted) until you answer the prompt. To bypass the prompt, and to delete queues that are being used by an active workflow, add the Force parameter. For example:

Get-CsRgsQueue –Identity "" | Remove-CsRgsQueue –Force

Remove-CsRgsQueue always checks to see if a queue is being used by an active workflow before it will delete that queue. However, the cmdlet does not verify whether or not the queue is being used by another queue as either the timeout or overflow queue. That means it is possible to delete a queue that is needed by another queue. Because of that, you might want to use the Get-CsRgsQueue cmdlet to check the OverflowAction and TimeoutAction properties of your other Response Group queues before running Remove-CsRgsQueue to delete a queue.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Remove-CsRgsQueue cmdlet locally: RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Remove-CsRgsQueue"}

Input Types

Microsoft.Rtc.Rgs.Management.WritableSettings.Queue object. Remove-CsRgsQueue accepts pipelined instances of the Response Group queue object.

Return Types

Remove-CsRgsQueue deletes existing instances of the Microsoft.Rtc.Rgs.Management.WritableSettings.Queue object.


-------------------------- Example 1 ------------------------

Copy Code
Get-CsRgsQueue -Identity | Remove-CsRgsQueue

The command shown in Example 1 deletes all the Response Group queues found on the service To do this, the command first uses Get-CsRgsQueue to return a collection of all the queues found on This collection is then piped to Remove-CsRgsQueue, which deletes each queue in the collection.

-------------------------- Example 2 ------------------------

Copy Code
Get-CsRgsQueue -Identity -Name "Help Desk Queue" | Remove-CsRgsQueue

In Example 2, a single Response Group queue is deleted: the queue named "Help Desk Queue", located on the service To delete this queue, Get-CsRgsQueue is called along with the Identity and Name parameters; the single queue returned by this call is then piped to, and deleted by, Remove-CsRgsQueue.

-------------------------- Example 3 ------------------------

Copy Code
Get-CsRgsQueue -Identity | Where-Object {$_.OverflowCandidate -eq "NewestCall"} | Remove-CsRgsQueue

The preceding command deletes all the Response Group queues found on the service, provided those queues have their OverflowCandidate property set to NewestCall. To do this, Get-CsRgsQueue is first called in order to return a collection of all the Response Group queues found on This collection is then piped to the Where-Object cmdlet, which selects only those queues where the OverflowCandidate property is equal to "NewestCall". The filtered collection is then piped to Remove-CsRgsQueue, which deletes each queue in the collection.

See Also