Skip to content

Commit 6d1013f

Browse files
authored
Merge pull request MicrosoftDocs#8439 from JensTrier/PhoneNumberAssignment
New Phone number assignment PS cmdlets
2 parents 41bc3ab + ce72c98 commit 6d1013f

File tree

2 files changed

+268
-0
lines changed

2 files changed

+268
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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-csphonenumberassignment
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-CsPhoneNumberAssignment
14+
15+
## SYNOPSIS
16+
This cmdlet will remove/unassign a phone number from a user or a resource account (online application instance).
17+
18+
> [!NOTE]
19+
> **Preview** The use of this cmdlet is in Public Preview.
20+
21+
## SYNTAX
22+
23+
```powershell
24+
Remove-CsPhoneNumberAssignment [[-Identity] <String> [-PhoneNumber <String>] [-PhoneNumberType <String>] [-RemoveAll] [<CommonParameters>]
25+
26+
```
27+
28+
## DESCRIPTION
29+
This cmdlet removes/unassigns a phone number from a user or resource account. The phone number continues to be available in the tenant.
30+
31+
Unassigning a phone number from a user or resource account will automatically set EnterpriseVoiceEnabled to False.
32+
33+
## EXAMPLES
34+
35+
### Example 1
36+
```powershell
37+
Remove-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -PhoneNumberType CallingPlan
38+
```
39+
This example removes/unassigns the Microsoft Calling Plan phone number +1 (206) 555-1234 from the user user1@contoso.com.
40+
41+
### Example 2
42+
```powershell
43+
Remove-CsPhoneNumberAssignment -Identity user2@contoso.com -RemoveAll
44+
```
45+
This example removes/unassigns the phone number from user2@contoso.com.
46+
47+
48+
## PARAMETERS
49+
50+
### -Identity
51+
The Id of the specific user or resource account. Can be specified using the ObjectId, the SIP address or the e-mail address.
52+
53+
```yaml
54+
Type: System.String
55+
Parameter Sets: (All)
56+
Aliases:
57+
58+
Required: True
59+
Default value: None
60+
Accept pipeline input: False
61+
Accept wildcard characters: False
62+
```
63+
64+
### -PhoneNumber
65+
The phone number to unnassign from the user or resource account. Supports E.164 format and non-E.164 format.
66+
67+
```yaml
68+
Type: System.String
69+
Parameter Sets: (All)
70+
Aliases:
71+
72+
Required: False
73+
Default value: None
74+
Accept pipeline input: False
75+
Accept wildcard characters: False
76+
```
77+
78+
### -PhoneNumberType
79+
The type of phone number to unassign from the user or resource account. The supported values are DirectRouting, CallingPlan and OperatorConnect.
80+
81+
```yaml
82+
Type: System.String
83+
Parameter Sets: (All)
84+
Aliases:
85+
86+
Required: False
87+
Default value: None
88+
Accept pipeline input: False
89+
Accept wildcard characters: False
90+
```
91+
92+
### -RemoveAll
93+
Unassigns the phone number from the user or resource account.
94+
95+
```yaml
96+
Type: Switch
97+
Parameter Sets: (All)
98+
Aliases:
99+
100+
Required: False
101+
Default value: None
102+
Accept pipeline input: False
103+
Accept wildcard characters: False
104+
```
105+
106+
### CommonParameters
107+
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).
108+
109+
## INPUTS
110+
111+
### None
112+
113+
## OUTPUTS
114+
115+
### System.Object
116+
117+
## NOTES
118+
The cmdlet is available in Teams PS module 2.6.1-preview or later.
119+
120+
## RELATED LINKS
121+
- [Set-CsPhoneNumberAssignment](Set-CsPhoneNumberAssignment.md)
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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/set-csphonenumberassignment
5+
applicable: Microsoft Teams
6+
author: jenstrier
7+
ms.author: jenstr
8+
ms.reviewer:
9+
manager:
10+
schema: 2.0.0
11+
---
12+
13+
# Set-CsPhoneNumberAssignment
14+
15+
## SYNOPSIS
16+
This cmdlet will assign a phone number to a user or a resource account (online application instance).
17+
18+
> [!NOTE]
19+
> **Preview** The use of this cmdlet is in Public Preview.
20+
21+
## SYNTAX
22+
23+
```powershell
24+
Set-CsPhoneNumberAssignment [[-Identity] <String> [-PhoneNumber <String>] [-PhoneNumberType <String>] [-LocationId <String>] [-EnterpriseVoiceEnabled <Boolean>][<CommonParameters>]
25+
26+
```
27+
28+
## DESCRIPTION
29+
This cmdlet assigns a phone number to a user or resource account.
30+
31+
## EXAMPLES
32+
33+
### Example 1
34+
```powershell
35+
Set-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -PhoneNumberType CallingPlan
36+
```
37+
This example assigns the Microsoft Calling Plan phone number +1 (206) 555-1234 to the user user1@contoso.com.
38+
39+
### Example 2
40+
```powershell
41+
$loc=Get-CsOnlineLisLocation -City Vancouver
42+
Set-CsPhoneNumberAssignment -Identity user2@contoso.com -PhoneNumber +12065551224 -PhoneNumberType CallingPlan -LocationId $loc.LocationId
43+
```
44+
This example finds the emergency location defined for the corporate location Vancouver and assigns the Microsoft Calling Plan phone number +1 (206) 555-1224 and location
45+
to the user user2@contoso.com.
46+
47+
### Example 3
48+
```powershell
49+
Set-CsPhoneNumberAssignment -Identity user3@contoso.com -EnterpriseVoiceEnabled $true
50+
```
51+
This example sets the EnterpriseVoiceEnabled flag on the user user2@contoso.com.
52+
53+
54+
## PARAMETERS
55+
56+
### -EnterpriseVoiceEnabled
57+
Flag indicating if the user or resource account should be EnterpriseVoiceEnabled.
58+
59+
This parameter is mutual exclusive with PhoneNumber.
60+
61+
```yaml
62+
Type: System.Boolean
63+
Parameter Sets: (All)
64+
Aliases:
65+
Applicable: Microsoft Teams
66+
67+
Required: False
68+
Default value: None
69+
Accept pipeline input: False
70+
Accept wildcard characters: False
71+
```
72+
73+
### -Identity
74+
The Id of the specific user or resource account. Can be specified using the ObjectId, the SIP address or the e-mail address.
75+
76+
```yaml
77+
Type: System.String
78+
Parameter Sets: (All)
79+
Aliases:
80+
81+
Required: True
82+
Default value: None
83+
Accept pipeline input: False
84+
Accept wildcard characters: False
85+
```
86+
87+
### -LocationId
88+
The Id of the location to assign to the specific user. You can get it using Get-CsOnlineLisLocation
89+
90+
```yaml
91+
Type: System.String
92+
Parameter Sets: (All)
93+
Aliases:
94+
95+
Required: False
96+
Default value: None
97+
Accept pipeline input: False
98+
Accept wildcard characters: False
99+
```
100+
101+
### -PhoneNumber
102+
The phone number to assign to the user or resource account. Supports E.164 format like +12065551234 and non-E.164 format like 12065551234. We are not currently supporting
103+
Direct Routing numbers with extensions, but you can use the Set-CsUser cmdlet for this.
104+
105+
Setting a phone number will automatically set EnterpriseVoiceEnabled to True.
106+
107+
```yaml
108+
Type: System.String
109+
Parameter Sets: (All)
110+
Aliases:
111+
112+
Required: False
113+
Default value: None
114+
Accept pipeline input: False
115+
Accept wildcard characters: False
116+
```
117+
118+
### -PhoneNumberType
119+
The type of phone number to assign to the user or resource account. The supported values are DirectRouting, CallingPlan and OperatorConnect.
120+
121+
```yaml
122+
Type: System.String
123+
Parameter Sets: (All)
124+
Aliases:
125+
126+
Required: False
127+
Default value: None
128+
Accept pipeline input: False
129+
Accept wildcard characters: False
130+
```
131+
132+
### CommonParameters
133+
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).
134+
135+
## INPUTS
136+
137+
### None
138+
139+
## OUTPUTS
140+
141+
### System.Object
142+
143+
## NOTES
144+
The cmdlet is available in Teams PS module 2.6.1-preview or later.
145+
146+
## RELATED LINKS
147+
- [Remove-CsPhoneNumberAssignment](Remove-CsPhoneNumberAssignment.md)

0 commit comments

Comments
 (0)