Commands › Microsoft Teams

Get-CsOnlineTelephoneNumber

Microsoft Teams MicrosoftTeams Get-*

Use the `Get-CsOnlineTelephoneNumber` to retrieve telephone numbers from the Business Voice Directory.

Quick start script

# Get-CsOnlineTelephoneNumber — 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-CsOnlineTelephoneNumber | Format-List

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

Syntax

Get-CsOnlineTelephoneNumber [-ActivationState <String>] [-Assigned <MultiValuedProperty>] [-CapitalOrMajorCity <String>] [-DomainController <Fqdn>] [-ExpandLocation] [-Force] [-InventoryType <MultiValuedProperty>] [-IsNotAssigned] [-ResultSize <UInt32>] [-TelephoneNumber <String>] [-TelephoneNumberGreaterThan <String>] [-TelephoneNumberLessThan <String>] [-TelephoneNumberStartsWith <String>] [-Tenant <Guid>] [<CommonParameters>]

Parameters (14)

ParameterTypeRequiredWhat it controls
-ActivationState String This parameter is reserved for internal Microsoft use.
-Assigned MultiValuedProperty Specifies the function of the telephone number. The acceptable values are:
-CapitalOrMajorCity String Specifies the city by a concatenated string in the form: region-country-area-city. For example, "NOAM-US-OR-PO" would specify Portland, Oregon.
-DomainController Fqdn This parameter is reserved for internal Microsoft use.
-ExpandLocation SwitchParameter Displays the location parameter with its value.
-Force SwitchParameter 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...
-InventoryType MultiValuedProperty Specifies the target telephone number type for the cmdlet. Acceptable values are:
-IsNotAssigned SwitchParameter Specifying this switch parameter will return only telephone numbers which are not assigned.
-ResultSize UInt32 Specifies the number of records returned by the cmdlet. The result size can be set to any whole number between 0 and 2147483647, inclusive. If set to 0, the command will run, but no data will be returned.
-TelephoneNumber String Specifies the target telephone number. For example:
-TelephoneNumberGreaterThan String Specifies a telephone number used by the cmdlet as the lower boundary of the telephone numbers returned. The telephone numbers returned will all be greater than the number provided. The telephone number should be in...
-TelephoneNumberLessThan String Specifies a telephone number used by the cmdlet as the upper boundary of the telephone numbers returned. The telephone numbers returned will all be less than the number provided. The telephone number should be in...
-TelephoneNumberStartsWith String Specifies the digits that the returned telephone numbers must begin with. To return numbers in the North American Numbering Plan 425 area code, use this syntax: -TelephoneNumberStartsWith 1425. To return numbers that...
-Tenant Guid This parameter is reserved for internal Microsoft use.

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