Skip to content

Commit d5903fc

Browse files
committed
Creating a new set of cmdlets for telephone number assignment blocking
These cmdlets allows a Teams Phone Admin to set assignment blocking on any telephone number.
1 parent dfd96ed commit d5903fc

File tree

4 files changed

+225
-1
lines changed

4 files changed

+225
-1
lines changed

teams/teams-ps/MicrosoftTeams/Get-CsPhoneNumberAssignment.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,12 @@ The activation state of the telephone number.
710710
### AssignedPstnTargetId
711711
The ID of the object the phone number is assigned to, either the ObjectId of a user or resource account or the policy instance ID of a Teams shared calling routing policy instance.
712712
713+
### AssignmentBlockedState
714+
The state of the number in terms of blocked assignment: NotBlocked if there is no assignment block on the number, BlockedForever if assignment is blocked indefinitely for the number, BlockedUntil if assignment is blocked for a specific amount of days (limited time assignment block currently not available).
715+
716+
### AssignmentBlockedUntil
717+
The date until which assignment is blocked for the phone number. Null if the number is blocked for assignment indefinitely.
718+
713719
### AssignmentCategory
714720
Contains the assignment category such as Primary or Private.
715721

teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This cmdlet will remove/unassign a phone number from a user or a resource accoun
2020
### RemoveSome (Default)
2121
```
2222
Remove-CsPhoneNumberAssignment -Identity <String> -PhoneNumber <String> -PhoneNumberType <String>
23-
[-HttpPipelinePrepend <SendAsyncStep[]>] [-Notify] [<CommonParameters>]
23+
[-HttpPipelinePrepend <SendAsyncStep[]>] [-Notify] [-AssignmentBlockedForever] [-AssignmentBlockedDays <Integer>] [<CommonParameters>]
2424
```
2525

2626
### RemoveAll
@@ -68,6 +68,18 @@ Remove-CsPhoneNumberAssignment -Identity [email protected] -RemoveAll -Notify
6868
```
6969
This example removes/unassigns all the telephone number from [email protected] and also sends an email notification to the user about the change.
7070

71+
### Example 5
72+
```powershell
73+
Remove-CsPhoneNumberAssignment -Identity [email protected] -PhoneNumber +12065551234 -AssignmentBlockedForever
74+
```
75+
This example removes/unassigns the telephone number from [email protected] and also sets an assignment block on the number for an indefinite duration.
76+
77+
### Example 6
78+
```powershell
79+
Remove-CsPhoneNumberAssignment -Identity [email protected] -PhoneNumber +12065551234 -AssignmentBlockedDays 30
80+
```
81+
This example removes/unassigns the telephone number from [email protected] and also sets an assignment block on the number for 30 days. ***This feature is currently not available.***
82+
7183
## PARAMETERS
7284

7385
### -HttpPipelinePrepend
@@ -161,6 +173,36 @@ Accept pipeline input: False
161173
Accept wildcard characters: False
162174
```
163175
176+
### -AssignmentBlockedForever
177+
Sets an assignment block for the phone number for an indefinite duration.
178+
179+
```yaml
180+
Type: System.Management.Automation.SwitchParameter
181+
Parameter Sets: (All)
182+
Aliases:
183+
184+
Required: False
185+
Position: Named
186+
Default value: None
187+
Accept pipeline input: False
188+
Accept wildcard characters: False
189+
```
190+
191+
### -AssignmentBlockedDays (Not yet supported)
192+
Sets an assignment block for the phone number for a specifed number of days. The value must be a valid integer between 1 and 365. ***This feature is currently not available.***
193+
194+
```yaml
195+
Type: Integer
196+
Parameter Sets: (All)
197+
Aliases:
198+
199+
Required: False
200+
Position: Named
201+
Default value: None
202+
Accept pipeline input: False
203+
Accept wildcard characters: False
204+
```
205+
164206
### CommonParameters
165207
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
166208
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
external help file: Microsoft.Teams.ConfigAPI.Cmdlets-help.xml
3+
Module Name: Microsoft.Teams.ConfigAPI.Cmdlets
4+
online version: https://learn.microsoft.com/powershell/module/teams/remove-csphonenumberassignmentblock
5+
applicable: Microsoft Teams
6+
title: Remove-CsPhoneNumberAssignmentBlock
7+
author: pavellatif
8+
ms.author: pavellatif
9+
ms.reviewer: pavellatif
10+
manager: roykuntz
11+
schema: 2.0.0
12+
---
13+
14+
# Remove-CsPhoneNumberAssignmentBlock
15+
16+
## SYNOPSIS
17+
This cmdlet allows the admin to remove an assignment block on a telephone number.
18+
19+
## SYNTAX
20+
```
21+
Remove-CsPhoneNumberAssignmentBlock -TelephoneNumber <String> [<CommonParameters>]
22+
```
23+
24+
## DESCRIPTION
25+
This cmdlet allows telephone number administrators to remove an existing assignment block on a telephone number.
26+
27+
## EXAMPLES
28+
29+
### Example 1
30+
```powershell
31+
PS C:\> Remove-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789
32+
```
33+
34+
The above example shows how to remove the assignment block on a +123456789 number.
35+
36+
## PARAMETERS
37+
38+
### -TelephoneNumber
39+
Indicates the phone number for the assignment block be removed from.
40+
41+
```yaml
42+
Type: System.String
43+
Parameter Sets: (All)
44+
Aliases:
45+
46+
Required: True
47+
Position: Named
48+
Default value: None
49+
Accept pipeline input: False
50+
Accept wildcard characters: False
51+
```
52+
53+
54+
### CommonParameters
55+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
56+
57+
## INPUTS
58+
59+
### None
60+
61+
## OUTPUTS
62+
63+
### None
64+
65+
## NOTES
66+
67+
## RELATED LINKS
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
external help file: Microsoft.Teams.ConfigAPI.Cmdlets-help.xml
3+
Module Name: Microsoft.Teams.ConfigAPI.Cmdlets
4+
online version: https://learn.microsoft.com/powershell/module/teams/set-csphonenumberassignmentblock
5+
applicable: Microsoft Teams
6+
title: Set-CsPhoneNumberAssignmentBlock
7+
author: pavellatif
8+
ms.author: pavellatif
9+
ms.reviewer: pavellatif
10+
manager: roykuntz
11+
schema: 2.0.0
12+
---
13+
14+
# Set-CsPhoneNumberAssignmentBlock
15+
16+
## SYNOPSIS
17+
This cmdlet allows the admin to create and assign a temporary block on telephone number assignment to selected telephone number.
18+
19+
## SYNTAX
20+
21+
```
22+
Set-CsPhoneNumberAssignmentBlock -TelephoneNumber <String> [-AssignmentBlockedForever] [-AssignmentBlockedDays <Integer>] [<CommonParameters>]
23+
```
24+
25+
## DESCRIPTION
26+
This cmdlet allows the teams phone administrators to create and assign a temporary block on telephone number assignment to selected telephone number. There are two ways to create the assignment block:
27+
1. Assignment is blocked until cleared. This can be set by -AssignmentBlockedForever parameter. Once set, the telephone number will remain unassignable until the block is cleared by an admin.
28+
2. Assignment is blocked for a set number of days. This can be achieved by setting -AssignmentBlockedDays parameter (this value must be a valid integer between 1 and 365 days). Once set, the telephone number will remain unassignable until the time runs out or the block is cleared by an admin. ***The -AssignmentBlockedDays parameter is currently not available***.
29+
30+
The admin **cannot** set both -AssignmentBlockedForever and -AssignmentBlockedDays for the same number. If there is an existing assignment block on the number, the admin must remove the existing block using [Remove-CsPhoneNumberAssignmentBlock](https://learn.microsoft.com/powershell/module/teams/remove-csphonenumberassignmentblock) before proceeding with setting the new assignment block.
31+
32+
## EXAMPLES
33+
34+
### Example 1
35+
```powershell
36+
PS C:\> Set-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789 -AssignmentBlockedForever
37+
```
38+
39+
The above example shows how to set an indefinite assignment block to a +123456789 number.
40+
41+
### Example 2
42+
```powershell
43+
PS C:\> Set-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789 -AssignmentBlockedDays 30
44+
```
45+
46+
The above example shows how to set an assignment block to a +123456789 number for 30 days. ***This feature is currently not available.***
47+
48+
## PARAMETERS
49+
50+
### -TelephoneNumber
51+
Indicates the phone number for the assignment block to be assigned.
52+
53+
```yaml
54+
Type: System.String
55+
Parameter Sets: (All)
56+
Aliases:
57+
58+
Required: True
59+
Position: Named
60+
Default value: None
61+
Accept pipeline input: False
62+
Accept wildcard characters: False
63+
```
64+
65+
### -AssignmentBlockedForever
66+
Sets an indefinite block on assignment for the telephone number.
67+
68+
```yaml
69+
Type: System.Management.Automation.SwitchParameter
70+
Parameter Sets: (All)
71+
Aliases:
72+
73+
Required: False
74+
Position: Named
75+
Default value: None
76+
Accept pipeline input: False
77+
Accept wildcard characters: False
78+
```
79+
80+
### -AssignmentBlockedDays
81+
Sets a duration based assignment block on the telephone number. ***This feature is currently not available.***
82+
83+
```yaml
84+
Type: System.Int32
85+
Parameter Sets: (All)
86+
Aliases:
87+
88+
Required: False
89+
Position: Named
90+
Default value: None
91+
Accept pipeline input: False
92+
Accept wildcard characters: False
93+
```
94+
95+
96+
### CommonParameters
97+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
98+
99+
## INPUTS
100+
101+
### None
102+
103+
## OUTPUTS
104+
105+
### None
106+
107+
## NOTES
108+
109+
## RELATED LINKS

0 commit comments

Comments
 (0)