From 3cd735b796cfc5667e9a3c0f28b5967b6242e5bd Mon Sep 17 00:00:00 2001 From: pavellatif <142821210+pavellatif@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:06:03 -0400 Subject: [PATCH 1/3] Creating new cmdlets for telephone number assignment block Introducing new cmdlets for telephone number assignment block. A number can be blocked from assignment for certain number of days or indefinitely. --- .../Get-CsPhoneNumberAssignment.md | 18 +++ .../Remove-CsPhoneNumberAssignment.md | 45 ++++++- .../Remove-CsPhoneNumberAssignmentBlock.md | 69 +++++++++++ .../Set-CsPhoneNumberAssignmentBlock.md | 110 ++++++++++++++++++ 4 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignmentBlock.md create mode 100644 teams/teams-ps/MicrosoftTeams/Set-CsPhoneNumberAssignmentBlock.md diff --git a/teams/teams-ps/MicrosoftTeams/Get-CsPhoneNumberAssignment.md b/teams/teams-ps/MicrosoftTeams/Get-CsPhoneNumberAssignment.md index 4499f33849..f76f4342ba 100644 --- a/teams/teams-ps/MicrosoftTeams/Get-CsPhoneNumberAssignment.md +++ b/teams/teams-ps/MicrosoftTeams/Get-CsPhoneNumberAssignment.md @@ -85,6 +85,8 @@ PstnPartnerName : Microsoft NumberSource : Online ReverseNumberLookup : {} Tag : {} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example displays information about the Microsoft Calling Plan subscriber phone number +1 (402) 555-1234. You can see that it is assigned to a user. @@ -114,6 +116,8 @@ PstnPartnerName : NumberSource : OnPremises ReverseNumberLookup : {} Tag : {} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example displays information about the Direct Routing phone number +1 (206) 555-1000;ext=524. You can see that it is assigned to a user. @@ -186,6 +190,8 @@ PstnPartnerName : NumberSource : OnPremises ReverseNumberLookup : {SkipInternalVoip} Tag : {} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example displays when SkipInternalVoip option is turned on for a number. @@ -215,6 +221,8 @@ PstnPartnerName : NumberSource : OnPremises ReverseNumberLookup : {} Tag : {} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example shows a way to use -Filter parameter to display information of a specific number. @@ -244,6 +252,8 @@ PstnPartnerName : NumberSource : OnPremises ReverseNumberLookup : {} Tag : {} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example shows a way to get filtered results using multiple Filter parameters. @@ -273,6 +283,8 @@ PstnPartnerName : NumberSource : OnPremises ReverseNumberLookup : {} Tag : {Engineering} +AssignmentBlockedState : +AssignmentBlockedUntil : ``` This example shows a way to get filtered results using tags. Tags are not case sensitive. @@ -710,6 +722,12 @@ The activation state of the telephone number. ### AssignedPstnTargetId The ID of the object the phone number is assigned to, either the ObjectId of a user or resource account or the policy instance ID of a Teams shared calling routing policy instance. +### AssignmentBlockedState +The state of the number in terms of blocked assignment: NotBlocked if there is no assignment block on the number, BlockedForever if assignment is blocked indefinitely for the number, BlockedUntil if assignment is blocked for a specific amount of days (limited time assignment block currently not available). + +### AssignmentBlockedUntil +The date until which assignment is blocked for the phone number. Null if the number is blocked for assignment indefinitely. + ### AssignmentCategory Contains the assignment category such as Primary or Private. diff --git a/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md index 35819f80d0..130e475007 100644 --- a/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md +++ b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md @@ -20,7 +20,7 @@ This cmdlet will remove/unassign a phone number from a user or a resource accoun ### RemoveSome (Default) ``` Remove-CsPhoneNumberAssignment -Identity -PhoneNumber -PhoneNumberType - [-HttpPipelinePrepend ] [-Notify] [] + [-HttpPipelinePrepend ] [-Notify] [-AssignmentBlockedForever] [-AssignmentBlockedDays ] [] ``` ### RemoveAll @@ -68,6 +68,18 @@ Remove-CsPhoneNumberAssignment -Identity user2@contoso.com -RemoveAll -Notify ``` This example removes/unassigns all the telephone number from user2@contoso.com and also sends an email notification to the user about the change. +### Example 5 +```powershell +Remove-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -AssignmentBlockedForever +``` +This example removes a telephone number assignment from user1@contoso.com and also sets an assignment block on the unassigned number for an indefinite duration. + +### Example 6 +```powershell +Remove-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -AssignmentBlockedDays 30 +``` +This example removes a telephone number assignment from user1@contoso.com and also sets an assignment block on the unassigned number for 30 days. Which means the telephone number will not be available for new assignment for 30 days or until the block is removed manually. The telephone number will automatically become available for assignment for 30 days period is over. ***This feature is currently not available.*** + ## PARAMETERS ### -HttpPipelinePrepend @@ -161,6 +173,37 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AssignmentBlockedForever +Sets an indefinite block on assignment for the telephone number. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AssignmentBlockedDays +Sets a duration based assignment block on the telephone number. The value must be a valid integer between 1 and 365. ***This feature is currently not available.*** + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignmentBlock.md b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignmentBlock.md new file mode 100644 index 0000000000..7c5f64bd9c --- /dev/null +++ b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignmentBlock.md @@ -0,0 +1,69 @@ +--- +applicable: Microsoft Teams +author: pavellatif +external help file: Microsoft.Teams.ConfigAPI.Cmdlets-help.xml +Locale: en-US +manager: roykuntz +Module Name: MicrosoftTeams +ms.author: pavellatif +ms.reviewer: pavellatif +online version: https://learn.microsoft.com/powershell/module/teams/remove-csphonenumberassignmentblock +schema: 2.0.0 +title: Remove-CsPhoneNumberAssignmentBlock +--- + + +# Remove-CsPhoneNumberAssignmentBlock + +## SYNOPSIS +This cmdlet allows the admin to remove an assignment block on a telephone number. + +## SYNTAX +``` +Remove-CsPhoneNumberAssignmentBlock -TelephoneNumber [] +``` + +## DESCRIPTION +This cmdlet allows telephone number administrators to remove an existing assignment block on a telephone number. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789 +``` + +The above example shows how to remove the assignment block on a +123456789 number. + +## PARAMETERS + +### -TelephoneNumber +Indicates the phone number for the assignment block be removed from. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### None + +## NOTES + +## RELATED LINKS diff --git a/teams/teams-ps/MicrosoftTeams/Set-CsPhoneNumberAssignmentBlock.md b/teams/teams-ps/MicrosoftTeams/Set-CsPhoneNumberAssignmentBlock.md new file mode 100644 index 0000000000..6b5cbc7fe7 --- /dev/null +++ b/teams/teams-ps/MicrosoftTeams/Set-CsPhoneNumberAssignmentBlock.md @@ -0,0 +1,110 @@ +--- +applicable: Microsoft Teams +author: pavellatif +external help file: Microsoft.Teams.ConfigAPI.Cmdlets-help.xml +Locale: en-US +manager: roykuntz +Module Name: MicrosoftTeams +ms.author: pavellatif +ms.reviewer: pavellatif +online version: https://learn.microsoft.com/powershell/module/teams/set-csphonenumberassignmentblock +schema: 2.0.0 +title: Set-CsPhoneNumberAssignmentBlock +--- + +# Set-CsPhoneNumberAssignmentBlock + +## SYNOPSIS +This cmdlet allows the admin to create and assign a temporary block on telephone number assignment to selected telephone number. + +## SYNTAX + +``` +Set-CsPhoneNumberAssignmentBlock -TelephoneNumber [-AssignmentBlockedForever] [-AssignmentBlockedDays ] [] +``` + +## DESCRIPTION +This cmdlet allows the teams phone administrators to create and assign a temporary block on telephone number assignment to selected telephone number. There are two ways to create the assignment block: +1. Assignment is blocked until cleared. This can be set by -AssignmentBlockedForever parameter. Once set, the telephone number will remain unassignable until the block is cleared by an admin. +2. Assignment is blocked for a set number of days. This can be achieved by setting -AssignmentBlockedDays parameter (this value must be a valid integer between 1 and 365 days). Once set, the telephone number will remain unassignable until the time runs out or the block is cleared by an admin. ***The -AssignmentBlockedDays parameter is currently not available***. + + The admin **cannot** set both -AssignmentBlockedForever and -AssignmentBlockedDays for the same number. If there is an existing assignment block on the number, the admin must remove the existing block using [Remove-CsPhoneNumberAssignmentBlock](https://learn.microsoft.com/powershell/module/teams/remove-csphonenumberassignmentblock) before proceeding with setting the new assignment block. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789 -AssignmentBlockedForever +``` + +The above example shows how to set an indefinite assignment block to a +123456789 number. + +### Example 2 +```powershell +PS C:\> Set-CsPhoneNumberAssignmentBlock -TelephoneNumber +123456789 -AssignmentBlockedDays 30 +``` + +The above example shows how to set an assignment block to a +123456789 number for 30 days. ***This feature is currently not available.*** + +## PARAMETERS + +### -TelephoneNumber +Indicates the phone number for the assignment block to be assigned. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AssignmentBlockedForever +Sets an indefinite block on assignment for the telephone number. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AssignmentBlockedDays +Sets a duration based assignment block on the telephone number. ***This feature is currently not available.*** + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### None + +## NOTES + +## RELATED LINKS From a848db2d3be290438a69fa45c0db8d3bdfc6f976 Mon Sep 17 00:00:00 2001 From: pavellatif <142821210+pavellatif@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:19:18 -0400 Subject: [PATCH 2/3] Update MicrosoftTeams.md --- teams/teams-ps/MicrosoftTeams/MicrosoftTeams.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/teams/teams-ps/MicrosoftTeams/MicrosoftTeams.md b/teams/teams-ps/MicrosoftTeams/MicrosoftTeams.md index 1ae5a869e2..8fc40b8767 100644 --- a/teams/teams-ps/MicrosoftTeams/MicrosoftTeams.md +++ b/teams/teams-ps/MicrosoftTeams/MicrosoftTeams.md @@ -1175,6 +1175,9 @@ Deletes an existing online voice routing policy. Online voice routing policies m ### [Remove-CsPhoneNumberAssignment](Remove-CsPhoneNumberAssignment.md) This cmdlet will remove/unassign a phone number from a user or a resource account (online application instance). +### [Remove-CsPhoneNumberAssignmentBlock](Remove-CsPhoneNumberAssignmentBlock.md) +This cmdlet allows the admin to remove an assignment block on a telephone number. + ### [Remove-CsPhoneNumberTag](Remove-CsPhoneNumberTag.md) This cmdlet allows admin to remove a tag from phone number. @@ -1487,6 +1490,9 @@ Use the `Set-CsOnlineVoiceUser` cmdlet to set the PSTN specific parameters (like ### [Set-CsPhoneNumberAssignment](Set-CsPhoneNumberAssignment.md) This cmdlet will assign a phone number to a user or a resource account (online application instance). +### [Set-CsPhoneNumberAssignmentBlock](Set-CsPhoneNumberAssignmentBlock.md) +This cmdlet allows the admin to create and assign a temporary block on telephone number assignment to selected telephone number. + ### [Set-CsPhoneNumberPolicyAssignment](Set-CsPhoneNumberPolicyAssignment.md) This cmdlet assigns a policy to a specific telephone number in Microsoft Teams. From 7bc2ebdee604e700bf869e8d611336c3a97cf788 Mon Sep 17 00:00:00 2001 From: pavellatif <142821210+pavellatif@users.noreply.github.com> Date: Wed, 15 Oct 2025 10:42:18 -0400 Subject: [PATCH 3/3] Updating supported cloud instances These cmdlets are also available on special cloud instances --- .../MicrosoftTeams/Get-CsExportAcquiredPhoneNumberStatus.md | 2 -- .../New-CsOnlineDirectRoutingTelephoneNumberUploadOrder.md | 2 -- .../MicrosoftTeams/New-CsOnlineTelephoneNumberReleaseOrder.md | 2 -- teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md | 2 -- 4 files changed, 8 deletions(-) diff --git a/teams/teams-ps/MicrosoftTeams/Get-CsExportAcquiredPhoneNumberStatus.md b/teams/teams-ps/MicrosoftTeams/Get-CsExportAcquiredPhoneNumberStatus.md index 431ad0fee9..0fcde5f547 100644 --- a/teams/teams-ps/MicrosoftTeams/Get-CsExportAcquiredPhoneNumberStatus.md +++ b/teams/teams-ps/MicrosoftTeams/Get-CsExportAcquiredPhoneNumberStatus.md @@ -101,7 +101,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES The cmdlet is available in Teams PowerShell module 6.1.0 or later. -The cmdlet is only available in commercial and GCC cloud instances. - ## RELATED LINKS [Get-CsExportAcquiredPhoneNumberStatus](https://learn.microsoft.com/powershell/module/microsoftteams/get-csexportacquiredphonenumberstatus) diff --git a/teams/teams-ps/MicrosoftTeams/New-CsOnlineDirectRoutingTelephoneNumberUploadOrder.md b/teams/teams-ps/MicrosoftTeams/New-CsOnlineDirectRoutingTelephoneNumberUploadOrder.md index 680bffd86a..f7cf486751 100644 --- a/teams/teams-ps/MicrosoftTeams/New-CsOnlineDirectRoutingTelephoneNumberUploadOrder.md +++ b/teams/teams-ps/MicrosoftTeams/New-CsOnlineDirectRoutingTelephoneNumberUploadOrder.md @@ -139,8 +139,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES The cmdlet is available in Teams PowerShell module 6.7.1 or later. -The cmdlet is only available in commercial and GCC cloud instances. - ## RELATED LINKS [Get-CsOnlineTelephoneNumberOrder](./get-csonlinetelephonenumberorder.md) [New-CsOnlineTelephoneNumberReleaseOrder](./new-csonlinetelephonenumberreleaseorder.md) diff --git a/teams/teams-ps/MicrosoftTeams/New-CsOnlineTelephoneNumberReleaseOrder.md b/teams/teams-ps/MicrosoftTeams/New-CsOnlineTelephoneNumberReleaseOrder.md index 8e87bbbe17..28bcee8acc 100644 --- a/teams/teams-ps/MicrosoftTeams/New-CsOnlineTelephoneNumberReleaseOrder.md +++ b/teams/teams-ps/MicrosoftTeams/New-CsOnlineTelephoneNumberReleaseOrder.md @@ -170,8 +170,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable The cmdlet is available in Teams PowerShell module 6.7.1 or later. -The cmdlet is only available in commercial and GCC cloud instances. - ## RELATED LINKS [Get-CsOnlineTelephoneNumberOrder](get-csonlinetelephonenumberorder.md) diff --git a/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md index 130e475007..dfe1c5c7ca 100644 --- a/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md +++ b/teams/teams-ps/MicrosoftTeams/Remove-CsPhoneNumberAssignment.md @@ -218,8 +218,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES The cmdlet is available in Teams PowerShell module 3.0.0 or later. -The cmdlet is only available in commercial and GCC cloud instances. - ## RELATED LINKS [Set-CsPhoneNumberAssignment](https://learn.microsoft.com/powershell/module/microsoftteams/set-csphonenumberassignment)