|
| 1 | +--- |
| 2 | +external help file: Microsoft.Open.Teams.CommonLibrary.dll-Help.xml |
| 3 | +Module Name: MicrosoftTeams |
| 4 | +online version: https://docs.microsoft.com/powershell/module/teams/new-csteamsunassignednumbertreatment |
| 5 | +applicable: Microsoft Teams |
| 6 | +author: jenstrier |
| 7 | +ms.author: jenstr |
| 8 | +ms.reviewer: |
| 9 | +manager: |
| 10 | +schema: 2.0.0 |
| 11 | +--- |
| 12 | + |
| 13 | +# New-CsTeamsUnassignedNumberTreatment |
| 14 | + |
| 15 | +## SYNOPSIS |
| 16 | +Creates a new treatment for how calls to an unassigned number range should be routed. The call can be routed to a user, an application or to an announcement service where a custom message will be played to the caller. |
| 17 | + |
| 18 | + |
| 19 | +> [!NOTE] |
| 20 | +> **Preview** The use of this cmdlet is in Public Preview. |
| 21 | + |
| 22 | +## SYNTAX |
| 23 | + |
| 24 | +```powershell |
| 25 | +New-CsTeamsUnassignedNumberTreatment [[-Identity] <String>] [-Pattern <string>] [-TargetType <User | ResourceAccount | Announcement>] [-Target <GUID>] [-TreatmentPriority <integer>] [-Description <string>] [-InMemory] [-TreatmentId <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] |
| 26 | +``` |
| 27 | + |
| 28 | +## DESCRIPTION |
| 29 | +This cmdlet creates a treatment for how calls to an unassigned number range should be routed. |
| 30 | + |
| 31 | +## EXAMPLES |
| 32 | + |
| 33 | +### Example 1 |
| 34 | +```powershell |
| 35 | +$RAObjectId = (Get-CsOnlineApplicationInstance -Identity [email protected]).ObjectId |
| 36 | +New-CsTeamsUnassignedNumberTreatment -Identity MainAA -Pattern "^\+15552223333$" -TargetType ResourceAccount -Target $RAObjectId -TreatmentPriority 1 |
| 37 | +``` |
| 38 | +This example creates a treatment that will route all calls to the number +1 (555) 222-3333 to the resource account [email protected]. |
| 39 | +That resource account is associated with an Auto Attendant (not part of the example). |
| 40 | + |
| 41 | +### Example 2 |
| 42 | +```powershell |
| 43 | +$Content = Get-Content "C:\Media\MainAnnoucement.wav" -Encoding byte -ReadCount 0 |
| 44 | +$AudioFile = Import-CsOnlineAudioFile -FileName "MainAnnouncement.wav" -Content $Content |
| 45 | +$Fid=[System.Guid]::Parse($audioFile.Id) |
| 46 | +New-CsTeamsUnassignedNumberTreatment -Identity TR1 -Pattern "^\+1555333\d{4}$" -TargetType Announcement -Target $Fid.Guid -TreatmentPriority 2 |
| 47 | +``` |
| 48 | +This example creates a treatment that will route all calls to the number range +1 (555) 333-0000 to +1 (555) 333-9999 to the announcement service, |
| 49 | +where the audio file MainAnnouncement.wav will be played to the caller. |
| 50 | + |
| 51 | + |
| 52 | +### Example 3 |
| 53 | +```powershell |
| 54 | +$UserObjectId = (Get-CsOnlineUser -Identity [email protected]).Identity |
| 55 | +New-CsTeamsUnassignedNumberTreatment -Identity TR2 -Pattern "^\+15552224444$" -TargetType User -Target $UserObjectId -TreatmentPriority 3 |
| 56 | +``` |
| 57 | +This example creates a treatment that will route all calls to the number +1 (555) 222-4444 to the user [email protected]. |
| 58 | + |
| 59 | + |
| 60 | +## PARAMETERS |
| 61 | + |
| 62 | +### -Description |
| 63 | +Free format description of this treatment. |
| 64 | + |
| 65 | +```yaml |
| 66 | +Type: System.String |
| 67 | +Parameter Sets: (All) |
| 68 | +Aliases: |
| 69 | + |
| 70 | +Required: False |
| 71 | +Default value: None |
| 72 | +Accept pipeline input: False |
| 73 | +Accept wildcard characters: False |
| 74 | +``` |
| 75 | +
|
| 76 | +### -Identity |
| 77 | +The Id of the treatment. |
| 78 | +
|
| 79 | +
|
| 80 | +```yaml |
| 81 | +Type: System.String |
| 82 | +Parameter Sets: (All) |
| 83 | +Aliases: |
| 84 | + |
| 85 | +Required: True |
| 86 | +Default value: None |
| 87 | +Accept pipeline input: False |
| 88 | +Accept wildcard characters: False |
| 89 | +``` |
| 90 | +
|
| 91 | +### -Pattern |
| 92 | +A regular expression that the called number must match in order for the treatment to take effect. It is best pratice to start the regular expression with the hat character and end it with the dollar character. |
| 93 | +You can use various regular expression test sites on the Internet to validate the expression. |
| 94 | +
|
| 95 | +```yaml |
| 96 | +Type: System.String |
| 97 | +Parameter Sets: (All) |
| 98 | +Aliases: |
| 99 | + |
| 100 | +Required: True |
| 101 | +Default value: None |
| 102 | +Accept pipeline input: False |
| 103 | +Accept wildcard characters: False |
| 104 | +``` |
| 105 | +
|
| 106 | +### -Target |
| 107 | +The identity of the destination the call should be routed to. Depending on the TargetType it should either be the ObjectId of the user or application instance/resource account or the AudioFileId of the uploaded audio file. |
| 108 | +
|
| 109 | +```yaml |
| 110 | +Type: System.Guid |
| 111 | +Parameter Sets: (All) |
| 112 | +Aliases: |
| 113 | + |
| 114 | +Required: True |
| 115 | +Default value: None |
| 116 | +Accept pipeline input: False |
| 117 | +Accept wildcard characters: False |
| 118 | +``` |
| 119 | +
|
| 120 | +### -TargetType |
| 121 | +The type of target used for the treatment. Allowed values are User, ResourceAccount and Announcement. |
| 122 | +
|
| 123 | +```yaml |
| 124 | +Type: System.String |
| 125 | +Parameter Sets: (All) |
| 126 | +Aliases: |
| 127 | + |
| 128 | +Required: True |
| 129 | +Default value: None |
| 130 | +Accept pipeline input: False |
| 131 | +Accept wildcard characters: False |
| 132 | +``` |
| 133 | +
|
| 134 | +### -TreatmentId |
| 135 | +The identity of the treatment. |
| 136 | +
|
| 137 | +```yaml |
| 138 | +Type: System.String |
| 139 | +Parameter Sets: (All) |
| 140 | +Aliases: |
| 141 | + |
| 142 | +Required: False |
| 143 | +Default value: None |
| 144 | +Accept pipeline input: False |
| 145 | +Accept wildcard characters: False |
| 146 | +``` |
| 147 | +
|
| 148 | +### -TreatmentPriority |
| 149 | +The priority of the treatment. Used to distinguish identical patterns. The lower the priority the higher preference. The priority needs to be unique. |
| 150 | +
|
| 151 | +```yaml |
| 152 | +Type: System.Integer |
| 153 | +Parameter Sets: (All) |
| 154 | +Aliases: |
| 155 | + |
| 156 | +Required: True |
| 157 | +Default value: None |
| 158 | +Accept pipeline input: False |
| 159 | +Accept wildcard characters: False |
| 160 | +``` |
| 161 | +
|
| 162 | +### CommonParameters |
| 163 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
| 164 | +
|
| 165 | +## INPUTS |
| 166 | +
|
| 167 | +### None |
| 168 | +
|
| 169 | +## OUTPUTS |
| 170 | +
|
| 171 | +### System.Object |
| 172 | +
|
| 173 | +## NOTES |
| 174 | +The cmdlet is available in Teams PS module 2.5.1 or later. |
| 175 | +
|
| 176 | +The parameters Identity and TreatmentId are mutually exclusive. |
| 177 | +
|
| 178 | +## RELATED LINKS |
| 179 | +- [Import-CSOnlineAudioFile](https://docs.microsoft.com/powershell/module/skype/import-csonlineaudiofile) |
| 180 | +
|
| 181 | +- [Get-CsTeamsUnassignedNumberTreatment](Get-CsTeamsUnassignedNumberTreatment.md) |
| 182 | +- [Remove-CsTeamsUnassignedNumberTreatment](Remove-CsTeamsUnassignedNumberTreatment.md) |
| 183 | +- [Set-CsTeamsUnassignedNumberTreatment](Set-CsTeamsUnassignedNumberTreatment.md) |
0 commit comments