Skip to content

Commit 95da8c8

Browse files
authored
Merge pull request #8384 from JensTrier/UnassignedNumbers
New PS cmdlets for unassigned number routing feature
2 parents 2a1b13a + e41dac5 commit 95da8c8

File tree

4 files changed

+549
-0
lines changed

4 files changed

+549
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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/get-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+
# Get-CsTeamsUnassignedNumberTreatment
14+
15+
## SYNOPSIS
16+
Displays a specific or all treatments for how calls to an unassigned number range should be routed.
17+
18+
> [!NOTE]
19+
> **Preview** The use of this cmdlet is in Public Preview.
20+
21+
## SYNTAX
22+
23+
```powershell
24+
Get-CsTeamsUnassignedNumberTreatment [-LocalStore] [[-Identity] <String>] [-Filter <String>] [<CommonParameters>]
25+
26+
```
27+
28+
## DESCRIPTION
29+
This cmdlet displays a specific or all treatments for how calls to an unassigned number range should be routed.
30+
31+
## EXAMPLES
32+
33+
### Example 1
34+
```powershell
35+
Get-CsTeamsUnassignedNumberTreatment -Identity MainAA
36+
```
37+
This example displays the treatment MainAA.
38+
39+
### Example 2
40+
```powershell
41+
Get-CsTeamsUnassignedNumberTreatment
42+
```
43+
This example displays all configured treatments.
44+
45+
46+
## PARAMETERS
47+
48+
### -Filter
49+
Enables you to limit the returned data by filtering on specific attributes.
50+
For example, you can limit returned data to treatments which have a specific target type, i.e. -Filter {TargetType -eq 'User'}. The Filter parameter uses the same filtering syntax that is used by the Where-Object cmdlet.
51+
52+
```yaml
53+
Type: String
54+
Parameter Sets: (All)
55+
Aliases:
56+
Applicable: Microsoft Teams
57+
58+
Required: False
59+
Default value: None
60+
Accept pipeline input: False
61+
Accept wildcard characters: False
62+
```
63+
### -Identity
64+
The Id of the specific treatment to show.
65+
66+
```yaml
67+
Type: System.String
68+
Parameter Sets: (All)
69+
Aliases:
70+
71+
Required: False
72+
Default value: None
73+
Accept pipeline input: False
74+
Accept wildcard characters: False
75+
```
76+
77+
### -LocalStore
78+
This parameter is reserved for internal Microsoft use.
79+
80+
```yaml
81+
Type: SwitchParameter
82+
Parameter Sets: (All)
83+
Aliases:
84+
85+
Required: False
86+
Default value: None
87+
Accept pipeline input: False
88+
Accept wildcard characters: False
89+
```
90+
91+
### CommonParameters
92+
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).
93+
94+
## INPUTS
95+
96+
### None
97+
98+
## OUTPUTS
99+
100+
### System.Object
101+
102+
## NOTES
103+
The cmdlet is available in Teams PS module 2.5.1 or later.
104+
105+
Using the Filter parameter does not work as intended.
106+
107+
## RELATED LINKS
108+
- [Remove-CsTeamsUnassignedNumberTreatment](Remove-CsTeamsUnassignedNumberTreatment.md)
109+
- [New-CsTeamsUnassignedNumberTreatment](New-CsTeamsUnassignedNumberTreatment.md)
110+
- [Set-CsTeamsUnassignedNumberTreatment](Set-CsTeamsUnassignedNumberTreatment.md)
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
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)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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/remove-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+
# Remove-CsTeamsUnassignedNumberTreatment
14+
15+
## SYNOPSIS
16+
Removes a treatment for how calls to an unassigned number range should be routed.
17+
18+
> [!NOTE]
19+
> **Preview** The use of this cmdlet is in Public Preview.
20+
21+
## SYNTAX
22+
23+
```powershell
24+
Remove-CsTeamsUnassignedNumberTreatment [[-Identity] <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
25+
```
26+
27+
## DESCRIPTION
28+
This cmdlet removes a treatment for how calls to an unassigned number range should be routed.
29+
30+
## EXAMPLES
31+
32+
### Example 1
33+
```powershell
34+
Remove-CsTeamsUnassignedNumberTreatment -Identity MainAA
35+
```
36+
This example removes the treatment MainAA.
37+
38+
39+
## PARAMETERS
40+
41+
### -Identity
42+
The Id of the specific treatment to remove.
43+
44+
```yaml
45+
Type: System.String
46+
Parameter Sets: (All)
47+
Aliases:
48+
49+
Required: True
50+
Default value: None
51+
Accept pipeline input: False
52+
Accept wildcard characters: False
53+
```
54+
55+
### -Force
56+
Specifies whether to suppress warning and confirmation messages. It can be useful in scripting to suppress interactive prompts. If the Force switch isn't provided in the command, you're prompted for administrative input if required.
57+
58+
```yaml
59+
Type: SwitchParameter
60+
Parameter Sets: (All)
61+
Aliases:
62+
63+
Required: False
64+
Position: Named
65+
Default value: False
66+
Accept pipeline input: False
67+
Accept wildcard characters: False
68+
```
69+
70+
### CommonParameters
71+
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).
72+
73+
## INPUTS
74+
75+
### System.Object
76+
77+
## OUTPUTS
78+
79+
### System.Object
80+
81+
## NOTES
82+
The cmdlet is available in Teams PS module 2.5.1 or later.
83+
84+
## RELATED LINKS
85+
- [Get-CsTeamsUnassignedNumberTreatment](Get-CsTeamsUnassignedNumberTreatment.md)
86+
- [New-CsTeamsUnassignedNumberTreatment](New-CsTeamsUnassignedNumberTreatment.md)
87+
- [Set-CsTeamsUnassignedNumberTreatment](Set-CsTeamsUnassignedNumberTreatment.md)

0 commit comments

Comments
 (0)