Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions teams/teams-ps/teams/Remove-CsPhoneNumberAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ This cmdlet will remove/unassign a phone number from a user or a resource accoun

### RemoveSome (Default)
```powershell
Remove-CsPhoneNumberAssignment -Identity <String> -PhoneNumber <String> -PhoneNumberType <String> [<CommonParameters>]
Remove-CsPhoneNumberAssignment -Identity <String> -PhoneNumber <String> -PhoneNumberType <String> -Notify [<CommonParameters>]
```

### RemoveAll
```powershell
Remove-CsPhoneNumberAssignment -Identity <String> -RemoveAll [<CommonParameters>]
Remove-CsPhoneNumberAssignment -Identity <String> -RemoveAll -Notify [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -34,7 +34,8 @@ This cmdlet removes/unassigns a phone number from a user or resource account. Th
Unassigning a phone number from a user or resource account will automatically set EnterpriseVoiceEnabled to False.

If the cmdlet executes successfully, no result object will be returned. If the cmdlet fails for any reason, a result object will be returned that contains a
Code string parameter and a Message string parameter with additional details of the failure.
Code string parameter and a Message string parameter with additional details of the failure. Email notification to end user is a best effort operation. No error message will be displayed if the email fails to send.


**Note**: In Teams PowerShell Module 4.2.1-preview and later we are changing how the cmdlet reports errors. Instead of using a result object, we will be generating an
exception in case of an error and we will be appending the exception to the $Error automatic variable. The cmdlet will also
Expand All @@ -46,13 +47,25 @@ now support the -ErrorAction parameter to control the execution after an error h
```powershell
Remove-CsPhoneNumberAssignment -Identity [email protected] -PhoneNumber +12065551234 -PhoneNumberType CallingPlan
```
This example removes/unassigns the Microsoft Calling Plan phone number +1 (206) 555-1234 from the user [email protected].
This example removes/unassigns the Microsoft Calling Plan telephone number +1 (206) 555-1234 from the user [email protected].

### Example 2
```powershell
Remove-CsPhoneNumberAssignment -Identity [email protected] -RemoveAll
```
This example removes/unassigns the phone number from [email protected].
This example removes/unassigns all the telephone number from [email protected].

### Example 3
```powershell
Remove-CsPhoneNumberAssignment -Identity [email protected] -PhoneNumber +12065551234 -PhoneNumberType CallingPlan -Notify
```
This example removes/unassigns the Microsoft Calling Plan phone number +1 (206) 555-1234 from the user [email protected] and also sends an email notification to the user about the removal of telephone number.

### Example 4
```powershell
Remove-CsPhoneNumberAssignment -Identity [email protected] -RemoveAll -Notify
```
This example removes/unassigns all the telephone number from [email protected] and also sends an email notification to the user about the change.

## PARAMETERS

Expand Down Expand Up @@ -113,6 +126,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Notify
Sends a best-effort email notification when a phone number is removed. Failures to send email are not reported.
```yaml
Type: Switch
Parameter Sets: (RemoveSome, RemoveAll)
Aliases:

Required: False
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
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).
Expand Down