New-CallQueue.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
<#PSScriptInfo
.VERSION 1.0 .GUID c8beba5e-f8e7-4356-981a-5f3917779fc0 .AUTHOR Aaron Guilmette .COMPANYNAME Microsoft .COPYRIGHT 2021 .TAGS New Call Queue Hunt Groups .LICENSEURI .PROJECTURI .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES .DESCRIPTION Create new call queue .PRIVATEDATA #> # Create call queue / hunt group param ( [Parameter(Mandatory=$true)][string]$Domain, [Parameter(Mandatory = $true)][string]$Name, [int16]$AgentAlertTime = 30, # Required parameter, but providing a default [bool]$AllowOptOut = $true, [guid[]]$DistributionLists, # This value must be populated with # Guids of objects that exist in the # tenant already - Security, # Distribution, or Office 365 Groups [System.Uri]$LineUri, [System.Byte[]]$MusicOnHoldFileContent, [string]$MusicOnHoldFileName, [ValidateSet('DisconnectWithBusy','Forward','Voicemail')]$OverflowAction = "DisconnectWithBusy", [System.Uri]$OverflowActionTarget, [ValidateRange(0,200)][int16]$OverflowThreshold = 50, [ValidateSet('Attendant','Serial')]$RoutingMethod = "Attendant", [ValidateSet('DisconnectWithBusy','Forward','Voicemail')]$TimeoutAction = "DisconnectWithBusy", [System.Uri]$TimeoutActionTarget, [ValidateRange(0,2700)][int16]$TimeoutThreshold = 1200, [bool]$UseDefaultMusicOnHold, [System.Byte[]]$WelcomeMusicFileContent, [string]$WelcomeMusicFileName ) $params = @{} # build the parameters foreach ($parameter in $PSBoundParameters.GetEnumerator()) { if ($parameter) { $params.Add($parameter.Key, $parameter.Value) } } if (!($params.ContainsKey('MusicOnHoldFileContent') -and $params.ContainsKey('MusicOnHoldFileName'))) { $params.Add('UseDefaultMusicOnHold',$true) } # Remove parameter WelcomeMusicFileName if WelcomeMusicFileContent not present if ($params.ContainsKey('WelcomeMusicFileName') -and -not $params.ContainsKey('WelcomeMusicFileContent')) { $params.Remove('WelcomeMusicFileName') } # Remove parameter WelcomeMusicFileContent if WelcomeMusicFileName not present if ($params.ContainsKey('WelcomeMusicFileContent') -and -not $params.ContainsKey('WelcomeMusicFileName')) { $params.Remove('WelcomeMusicFileContent') } # create the call queue if none exists If (!(Get-CsHuntGroup -wa SilentlyContinue | ? { $_.Name -eq $Name})) { New-CSHuntGroup @params } |