[This is pre-release documentation and subject to change in future releases. This topic's current status is: Writing Not Started]

Topic Last Modified: 2010-07-18

The following script creates a basic response group for use with the Response Group Service in Microsoft Communications Server 2010. To use the script, copy the code, paste it into a text editor such as Windows Notepad, and then save the file using a .ps1 file extension (for example, C:\Scripts\NewResponseGroup.Ps1). From within the Communications Server Management Shell you can then run the script by typing in the full path to the script file:

Copy Code
C:\Scripts\NewResponseGroup.ps1

The script itself is as follows:

Copy Code
<#
	Description  : Create a basic hunt group.
	Author	 : Frédéric Dubut (Microsoft)
#>

$serviceid = "service:Contoso-ApplicationServer-1"

#
# Create group
#
$group = New-CSRgsAgentGroup `
	-Parent $serviceId `
	-Name "Contoso Reception" `
	-AgentAlertTime 20 `
	-ParticipationPolicy Informal `
	-RoutingMethod Attendant `
	-AgentsByUri("sip:mindy@contoso.com", `
		"sip:bob@contoso.com")
Set-CSRgsAgentGroup $group

#
# Create queue
#
$prompt_to = New-CSRgsWorkflowPrompt `
	-PromptTts "Sorry, all our agents are busy. Please call back later." + `
		" Thank you."
$action_to = New-CSRgsCallAction `
	-Prompt $prompt_to `
	-Target Terminate
$prompt_of = New-CSRgsWorkflowPrompt `
	-PromptTts "Sorry, there are too many calls waiting. Please call back later." + `
		" Thank you."
$action_of = New-CSRgsCallAction `
	-Prompt $prompt_of `
	-Target Terminate

$queue = New-CSRgsQueue  `
	-Parent $serviceId  `
	-Name "Contoso Reception" `
	-TimeoutThreshold 300 `
	-TimeoutAction $action_to `
	-OverflowThreshold 5 `
	-OverflowCandidate NewestCall `
	-OverflowAction $action_of `
	-AgentGroupsId($group.Identity)
Set-CSRgsQueue $queue

#
# Create workflow
#
$sipuri = "sip:reception@contoso.com"
$prompt_wm = New-CSRgsWorkflowPrompt `
	-PromptTTS "Welcome to the Contoso Reception line. " `
		 "Please wait for an available agent to answer."
$action_wm = New-CSRgsCallAction `
	-Prompt $prompt_wm `
	-Target TransferToQueue `
	-TargetQueueId $queue.Identity

$rg = New-CSRgsWorkflow `
	-Parent $serviceId `
	-Name "Contoso Reception" `
	-Description "The Contoso Reception line." `
	-PrimaryUri $sipuri `
	-Active $true `
	-Anonymized $true `
	-NextTarget $action_wm
Set-CSRgsWorkflow $rg