Remove-CsOnlineTelephoneNumber
Use the Remove-CsOnlineTelephoneNumber
cmdlet to remove one or more unassigned telephone numbers from your tenant.
Syntax
Remove-CsOnlineTelephoneNumber
-TelephoneNumber <String[]>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This cmdlet removes one or more unassigned telephone numbers from your tenant. If at least one of the telephone numbers is assigned to a user or resource account, the cmdlet will fail and will not remove any of the specified telephone numbers.
Examples
-------------------------- Example 1 --------------------------
Remove-CsOnlineTelephoneNumber -TelephoneNumber 14258884567
NumberIdsDeleted NumberIdsDeleteFailed NumberIdsNotOwnedByTenant NumberIdsManagedByServiceDesk
---------------- --------------------- ------------------------- -----------------------------
{14258884567} {} {} {}
This example removes the specified telephone number from the tenant.
-------------------------- Example 2 --------------------------
[string[]]$tns="+14255551234","+14255551233"
Remove-CsOnlineTelephoneNumber -TelephoneNumber $tns
NumberIdsDeleted NumberIdsDeleteFailed NumberIdsNotOwnedByTenant NumberIdsManagedByServiceDesk
---------------- --------------------- ------------------------- -----------------------------
{14255551234, {} {} {}
14255551233}
This example removes the specified list of telephone numbers from the tenant.
Parameters
-Confirm
The Confirm switch causes the command to pause processing and requires confirmation to proceed.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
The Force switch specifies whether to suppress warning and confirmation messages. It can be useful in scripting to suppress interactive prompts. If the Force switch isn't provided in the command, you're prompted for administrative input if required.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TelephoneNumber
Specifies the telephone number(s) to remove. The format can be with or without the prefixed +, but needs to include country code etc.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
The WhatIf switch causes the command to simulate its results. By using this switch, you can view what changes would occur without having to commit those changes.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
None
Notes
If one or more of the telephone numbers are assigned to a user or a service, the cmdlet will display an error message and none of the telephone numbers specified will be removed from your tenant.
Related Links
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기