File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,29 @@ Set-CsPhoneNumberAssignment -PhoneNumber +12065551224 -LocationId $loc.LocationI
110
110
```
111
111
This example shows how to set the location on a phone number.
112
112
113
+ ### Example 10
114
+ ``` powershell
115
+ $OldLocationId = "7fda0c0b-6a3d-48b8-854b-3fbe9dcf6513"
116
+ $NewLocationId = "951fac72-955e-4734-ab74-cc4c0f761c0b"
117
+ # Get all phone numbers in old location
118
+ $pns = Get-CsPhoneNumberAssignment -LocationId $OldLocationId
119
+ Write-Host $pns.count numbers found in old location $OldLocationId
120
+ # Move all those phone numbers to the new location
121
+ foreach ($pn in $pns) {
122
+ Try {
123
+ Set-CsPhoneNumberAssignment -PhoneNumber $pn.TelephoneNumber -LocationId $NewLocationId -ErrorAction Stop
124
+ Write-Host $pn.TelephoneNumber was updated to have location $NewLocationId
125
+ }
126
+ Catch {
127
+ Write-Host Could not update $pn.TelephoneNumber with location $NewLocationId
128
+ }
129
+ }
130
+ Write-Host (Get-CsPhoneNumberAssignment -LocationId $OldLocationId).Count numbers found in old location $OldLocationId
131
+ Write-Host (Get-CsPhoneNumberAssignment -LocationId $NewLocationId).Count numbers found in new location $NewLocationId
132
+ ```
133
+ This Example shows how to update the LocationID from an old location to a new location for a set of phone numbers.
134
+
135
+
113
136
## PARAMETERS
114
137
115
138
### -AssignmentCategory
You can’t perform that action at this time.
0 commit comments