Commands › Microsoft Teams

Get-CsPhoneNumberAssignment

Microsoft Teams MicrosoftTeams Get-*

This cmdlet displays information about one or more phone numbers.

Quick start script

# Get-CsPhoneNumberAssignment — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Run and inspect
Get-CsPhoneNumberAssignment | Format-List

# 3. Export for evidence / drift tracking
Get-CsPhoneNumberAssignment | Export-Clixml .\CsPhoneNumberAssignment-$(Get-Date -Format yyyyMMdd).xml

Syntax

Get-CsPhoneNumberAssignment [-ActivationState <String>] [-AssignedPstnTargetId <String>]
 [-AssignmentCategory <String>] [-CapabilitiesContain <String>] [-CivicAddressId <String>] [-Filter <String>]
 [-IsoCountryCode <String>] [-LocationId <String>] [-NetworkSiteId <String>] [-NumberType <String>]
 [-PstnAssignmentStatus <String>] [-Skip <Int32>] [-TelephoneNumber <String>]
 [-TelephoneNumberContain <String>] [-TelephoneNumberGreaterThan <String>] [-TelephoneNumberLessThan <String>]
 [-TelephoneNumberStartsWith <String>] [-Top <Int32>] [-Break] [-HttpPipelineAppend <SendAsyncStep[]>]
 [-HttpPipelinePrepend <SendAsyncStep[]>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]
 [-ProxyUseDefaultCredentials] [<CommonParameters>]

Parameters (24)

ParameterTypeRequiredWhat it controls
-ActivationState String Filters the returned results based on activation state. Supported values are Activated, AssignmentPending, AssignmentFailed, UpdatePending, and UpdateFailed.
-AssignedPstnTargetId String Filters the returned results based on the user or resource account ID the phone number is assigned to. Supported values are UserPrincipalName, SIP address, ObjectId, and the Teams shared calling routing policy instance name.
-AssignmentCategory String Filters the returned results based on assignment category. Supported values include Primary, Alternate, and Private.
-Break SwitchParameter Waits for a .NET debugger to attach before running.
-CapabilitiesContain String 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,...
-CivicAddressId String Filters the returned results based on the CivicAddressId assigned to the phone number. You can get the CivicAddressId by using...
-Filter String This can be used to filter on one or more parameters within the search results.
-HttpPipelineAppend SendAsyncStep[] Specifies SendAsync pipeline steps to append to the generated HTTP pipeline.
-HttpPipelinePrepend SendAsyncStep[] Specifies SendAsync pipeline steps to prepend to the generated HTTP pipeline.
-IsoCountryCode String Filters the returned results based on the ISO 3166-1 Alpha-2 country code assigned to the phone number.
-LocationId String Filters the returned results based on the LocationId assigned to the phone number. You can get the LocationId by using...
-NetworkSiteId String ID of a network site. A network site represents a location where your organization has a physical venue, such as offices, a set of buildings, or a campus.
-NumberType String Filters the returned results based on the number type. Supported values are DirectRouting, CallingPlan, and OperatorConnect.
-Proxy Uri Specifies the URI of the proxy server to use for the request.
-ProxyCredential PSCredential Specifies credentials for a proxy server that requires authentication.
-ProxyUseDefaultCredentials SwitchParameter Indicates that the cmdlet uses the credentials of the current user for proxy authentication.
-PstnAssignmentStatus String Filters the returned results based on the assignment status. Supported values are Unassigned, UserAssigned, ConferenceAssigned, VoiceApplicationAssigned, ThirdPartyAppAssigned, and PolicyAssigned.
-Skip Int32 Skips the first X returned results and the default value is 0.
-TelephoneNumber String Filters the returned results to a specific phone number. It is optional to specify a prefixed "+". The phone number can't have "tel:" prefixed. We support Direct Routing numbers with extensions using the formats...
-TelephoneNumberContain String Filters the returned results based on a substring match against TelephoneNumber. To search for a number with an extension, specify the digits of the extension. For supported formats, see TelephoneNumber.
-TelephoneNumberGreaterThan String Filters the returned results to phone numbers greater than the specified TelephoneNumber value. You can use this parameter with TelephoneNumberLessThan to specify a range of phone numbers. For supported formats, see...
-TelephoneNumberLessThan String Filters the returned results to phone numbers less than the specified TelephoneNumber value. You can use this parameter with TelephoneNumberGreaterThan to specify a range of phone numbers. For supported formats, see...
-TelephoneNumberStartsWith String Filters the returned results to phone numbers that start with the specified TelephoneNumber value. For supported formats, see TelephoneNumber.
-Top Int32 Returns the first X returned results and the default value is 500.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.