Skip to content

Commit ae44f68

Browse files
authored
Merge pull request #11072 from JensTrier/JensUpdate15
Updates to Get/Set-CsPhoneNumberAssignment
2 parents 3bf3181 + b681b16 commit ae44f68

File tree

2 files changed

+66
-17
lines changed

2 files changed

+66
-17
lines changed

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ This cmdlet displays information about one or more phone numbers.
1919

2020
### Assignment (Default)
2121
```powershell
22-
Get-CsPhoneNumberAssignment [-ActivationState <string>] [-AssignedPstnTargetId <string>] [-CapabilitiesContain <string>] [-CivicAddressId <string>] [-IsoCountryCode <string>] [-LocationId <string>] [-NumberType <string>] [-PstnAssignmentStatus <string>] [-Skip <int>] [-TelephoneNumber <string>] [-TelephoneNumberContain <string>] [-TelephoneNumberGreaterThan <string>] [-TelephoneNumberLessThan <string>] [-TelephoneNumberStartsWith <string>] [-Top <int>] [<CommonParameters>]
22+
Get-CsPhoneNumberAssignment [-ActivationState <string>] [-AssignedPstnTargetId <string>] [-AssignmentCategory <string>]
23+
[-CapabilitiesContain <string>] [-CivicAddressId <string>] [-IsoCountryCode <string>]
24+
[-LocationId <string>] [-NumberType <string>] [-PstnAssignmentStatus <string>] [-Skip <int>] [-TelephoneNumber <string>]
25+
[-TelephoneNumberContain <string>] [-TelephoneNumberGreaterThan <string>] [-TelephoneNumberLessThan <string>]
26+
[-TelephoneNumberStartsWith <string>] [-Top <int>] [<CommonParameters>]
2327
```
2428

2529
## DESCRIPTION
2630
This cmdlet displays information about one or more phone numbers. You can filter the phone numbers to return by using different parameters.
2731

28-
Returned results are sorted by TelephoneNumber in ascending order.
32+
Returned results are sorted by TelephoneNumber in ascending order.
2933

3034
If you are using both -Skip X and -Top Y for filtering, the returned results will first be skipped by X, and then the top Y results will be returned.
3135

32-
3336
## EXAMPLES
3437

3538
### Example 1
@@ -41,6 +44,7 @@ TelephoneNumber : +14025551234
4144
NumberType : CallingPlan
4245
ActivationState : Activated
4346
AssignedPstnTargetId : dc13d97b-7897-494e-bc28-6b469bf7a70e
47+
AssignmentCategory : Primary
4448
Capability : {UserAssignment}
4549
City : Omaha
4650
CivicAddressId : 703b30e5-dbdd-4132-9809-4c6160a6acc7
@@ -64,6 +68,7 @@ TelephoneNumber : +12065551000;ext=524
6468
NumberType : DirectRouting
6569
ActivationState : Activated
6670
AssignedPstnTargetId : 2713551e-ed63-415d-9175-fc4ff825a0be
71+
AssignmentCategory : Primary
6772
Capability : {ConferenceAssignment, VoiceApplicationAssignment, UserAssignment}
6873
City :
6974
CivicAddressId : 00000000-0000-0000-0000-000000000000
@@ -152,6 +157,21 @@ Accept pipeline input: False
152157
Accept wildcard characters: False
153158
```
154159
160+
### -AssignmentCategory
161+
This parameter is reserved for internal Microsoft use.
162+
163+
```yaml
164+
Type: System.String
165+
Parameter Sets: (All)
166+
Aliases:
167+
Applicable: Microsoft Teams
168+
169+
Required: False
170+
Default value: None
171+
Accept pipeline input: False
172+
Accept wildcard characters: False
173+
```
174+
155175
### -CapabilitiesContain
156176
Filters the returned results based on the capabilities assigned to the phone number. You can specify one or more capabilities delimited by a comma. Supported capabilities are ConferenceAssignment, VoiceApplicationAssignment, UserAssignment, and TeamsPhoneMobile.
157177
@@ -370,6 +390,9 @@ The activation state of the telephone number.
370390
### AssignedPstnTargetId
371391
The ID of the object the phone number is assigned to.
372392
393+
### AssignmentCategory
394+
This parameter is reserved for internal Microsoft use.
395+
373396
### Capability
374397
The list of capabilities assigned to the phone number.
375398
@@ -412,7 +435,7 @@ The phone number. The number is always displayed with prefixed "+", even if it w
412435
The object returned is of type SkypeTelephoneNumberMgmtCmdletAcquiredTelephoneNumber.
413436
414437
## NOTES
415-
The cmdlet is available in Teams PowerShell module 4.0.0 or later.
438+
The cmdlet is available in Teams PowerShell module 4.0.0 or later. The parameter AssignmentCategory was introduced in Teams PowerShell module 5.3.1-preview.
416439
417440
The cmdlet is only available in commercial and GCC cloud instances.
418441

teams/teams-ps/teams/Set-CsPhoneNumberAssignment.md

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ This cmdlet will assign a phone number to a user or a resource account (online a
1717

1818
## SYNTAX
1919

20-
### Assignment (Default)
20+
### LocationUpdate (Default)
2121
```powershell
22-
Set-CsPhoneNumberAssignment -Identity <String> -PhoneNumber <String> -PhoneNumberType <String> [-LocationId <String>] [<CommonParameters>]
22+
Set-CsPhoneNumberAssignment -PhoneNumber <string> -LocationId <string> [<CommonParameters>]
23+
```
24+
25+
### Assignment
26+
```powershell
27+
Set-CsPhoneNumberAssignment -Identity <String> -PhoneNumber <String> -PhoneNumberType <String>
28+
[-LocationId <String>] [-AssignmentCategory <string>] [<CommonParameters>]
2329
```
2430

2531
### Attribute
@@ -30,8 +36,7 @@ Set-CsPhoneNumberAssignment -Identity <String> -EnterpriseVoiceEnabled <Boolean>
3036
## DESCRIPTION
3137
This cmdlet assigns a phone number to a user or resource account. When you assign a phone number the EnterpriseVoiceEnabled flag is automatically set to True.
3238

33-
You can also assign a location to a phone number when you assign the phone number to a user.
34-
39+
You can also assign a location to a phone number.
3540

3641
To remove a phone number from a user or resource account, use the [Remove-CsPhoneNumberAssignment](Remove-CsPhoneNumberAssignment.md) cmdlet.
3742

@@ -93,9 +98,30 @@ foreach ($No in $Numbers) {
9398
```
9499
This example shows how to change the location for unassigned Calling Plan subscriber phone numbers by looping through all the phone numbers, assigning each phone number temporarily with the new location to a user, and then unassigning the phone number again from the user.
95100

101+
### Example 9
102+
```powershell
103+
$loc=Get-CsOnlineLisLocation -City Toronto
104+
Set-CsPhoneNumberAssignment -PhoneNumber +12065551224 -LocationId $loc.LocationId
105+
```
106+
This example shows how to set the location on a phone number.
96107

97108
## PARAMETERS
98109

110+
### -AssignmentCategory
111+
This parameter is reserved for internal Microsoft use.
112+
113+
```yaml
114+
Type: System.String
115+
Parameter Sets: (Assignment)
116+
Aliases:
117+
Applicable: Microsoft Teams
118+
119+
Required: False
120+
Default value: None
121+
Accept pipeline input: False
122+
Accept wildcard characters: False
123+
```
124+
99125
### -EnterpriseVoiceEnabled
100126
Flag indicating if the user or resource account should be EnterpriseVoiceEnabled.
101127
@@ -107,7 +133,7 @@ Parameter Sets: (Attribute)
107133
Aliases:
108134
Applicable: Microsoft Teams
109135

110-
Required: False
136+
Required: True
111137
Default value: None
112138
Accept pipeline input: False
113139
Accept wildcard characters: False
@@ -129,17 +155,18 @@ Accept wildcard characters: False
129155
```
130156
131157
### -LocationId
132-
The LocationId of the location to assign to the specific user. You can get it using Get-CsOnlineLisLocation.
158+
The LocationId of the location to assign to the specific user. You can get it using Get-CsOnlineLisLocation. You can set the location on both assigned and unassigned
159+
phone numbers.
133160
134161
Removal of location from a phone number is supported for Direct Routing numbers and Operator Connect numbers that are not managed by the Service Desk.
135162
If you want to remove the location, use the string value null for LocationId.
136163
137164
```yaml
138165
Type: System.String
139-
Parameter Sets: (Assignment)
166+
Parameter Sets: (Assignment, LocationUpdate)
140167
Aliases:
141168

142-
Required: False
169+
Required: True
143170
Default value: None
144171
Accept pipeline input: False
145172
Accept wildcard characters: False
@@ -154,10 +181,10 @@ Setting a phone number will automatically set EnterpriseVoiceEnabled to True.
154181
155182
```yaml
156183
Type: System.String
157-
Parameter Sets: (Assignment)
184+
Parameter Sets: (Assignment, LocationUpdate)
158185
Aliases:
159186

160-
Required: False
187+
Required: True
161188
Default value: None
162189
Accept pipeline input: False
163190
Accept wildcard characters: False
@@ -171,7 +198,7 @@ Type: System.String
171198
Parameter Sets: (Assignment)
172199
Aliases:
173200

174-
Required: False
201+
Required: True
175202
Default value: None
176203
Accept pipeline input: False
177204
Accept wildcard characters: False
@@ -189,7 +216,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
189216
### System.Object
190217
191218
## NOTES
192-
The cmdlet is available in Teams PowerShell module 3.0.0 or later.
219+
The cmdlet is available in Teams PowerShell module 3.0.0 or later. The parameter set LocationUpdate was introduced in Teams PowerShell module 5.3.1-preview.
193220
194221
The cmdlet is only available in commercial and GCC cloud instances.
195222
@@ -198,7 +225,6 @@ If a user or resource account has a phone number set in Active Directory on-prem
198225
The previous command for assigning phone numbers to users Set-CsUser had the parameter HostedVoiceMail. Setting HostedVoiceMail for Microsoft Teams users is no longer
199226
necessary and that is why the parameter is not available on Set-CsPhoneNumberAssignment.
200227
201-
202228
## RELATED LINKS
203229
[Remove-CsPhoneNumberAssignment](Remove-CsPhoneNumberAssignment.md)
204230

0 commit comments

Comments
 (0)