Edit

Share via


New-CsOnlineTelephoneNumberOrder

Use the New-CsOnlineTelephoneNumberOrder cmdlet to create a telephone number search order. The telephone numbers can then be used to set up calling features for users and services in your organization.

Syntax

Default (Default)

New-CsOnlineTelephoneNumberOrder
    [-Name] <orderName>
    [-Description] <orderDescription>
    [-Country] <countryCode>
    [-NumberType] <numberType>
    [-Quantity] <quantity>
    [-CivicAddressId] <civicAddressId>
    [-NumberPrefix] <numberPrefix>
    [-AreaCode] <areaCode>
    [<CommonParameters>]

Description

Use the New-CsOnlineTelephoneNumberOrder cmdlet to create a telephone number search order. The telephone numbers can then be used to set up calling features for users and services in your organization. Use the Get-CsOnlineTelephoneNumberType cmdlet to find out the supported types of searches for each NumberType and construct the search request demonstrated below:

Telephone numbers can be created with 3 ways:

  • Civic Address Search: A telephone number search order can be created base on a given civic address ID. The service will look up the address and fulfill the search order using available telephone numbers local to the given address. For civic address based search, the parameter CivicAddressId is required.

  • Number Prefix Search: A telephone number search order can be created base on a given number prefix. The number prefix search allow the tenant to acquire telephone numbers with a fixed number prefix. For number prefix based search, the parameter NumberPrefix is required.

  • Area Code Selection Search: A telephone number search order can be created base on a give area code. Certain service numbers are only offered with a dedicated set of area codes. With area code selection search, the tenant can acquire the desired telephone numbers by area code. For area code selection based search, the parameter AreaCode is required.

Examples

Example 1

PS C:\> $orderId = New-CsOnlineTelephoneNumberOrder -Name "Example 1" -Description "Civic address search example" -Country "US" -NumberType "UserSubscriber" -Quantity 1 -CivicAddressId 3b175352-4131-431e-970c-273226b8fb46
PS C:\> $order = Get-CsOnlineTelephoneNumberOrder -OrderId $orderId

AreaCode              :
CivicAddressId        : 3b175352-4131-431e-970c-273226b8fb46
CountryCode           : US
CreatedAt             : 8/23/2021 5:43:44 PM
Description           : Civic address search example
ErrorCode             : NoError
Id                    : 1efd85ca-dd46-41b3-80a0-2e4c5f87c912
InventoryType         : Subscriber
IsManual              : False
Name                  : Example 1
NumberPrefix          :
NumberType            : UserSubscriber
Quantity              : 1
ReservationExpiryDate : 8/23/2021 5:59:45 PM
SearchType            : CivicAddress
SendToServiceDesk     : False
Status                : Reserved
TelephoneNumber       : {Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Models.TelephoneNumberSearchResult}

PS C:\> $order.TelephoneNumber

Location      TelephoneNumber
--------      ---------------
New York City +17182000004

This example demonstrates a civic address based telephone number search. Telephone number +17182000004 is found to belong to the given address and is reserved for purchase.

Example 2

PS C:\> $orderId = New-CsOnlineTelephoneNumberOrder -Name "Example 2" -Description "Number prefix search example" -Country "US" -NumberType "UserSubscriber" -Quantity 1 -NumberPrefix 1425
PS C:\> $order = Get-CsOnlineTelephoneNumberOrder -OrderId $orderId

AreaCode              :
CivicAddressId        :
CountryCode           : US
CreatedAt             : 8/23/2021 5:43:44 PM
Description           : Number prefix search example
ErrorCode             : NoError
Id                    : 1efd85ca-dd46-41b3-80a0-2e4c5f87c912
InventoryType         : Subscriber
IsManual              : False
Name                  : Example 2
NumberPrefix          :
NumberType            : UserSubscriber
Quantity              : 1
ReservationExpiryDate : 8/23/2021 5:59:45 PM
SearchType            : Prefix
SendToServiceDesk     : False
Status                : Reserved
TelephoneNumber       : {Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Models.TelephoneNumberSearchResult}

PS C:\> $order.TelephoneNumber

Location      TelephoneNumber
--------      ---------------
Bellevue  +14252000004

This example demonstrates a number prefix based telephone number search. Telephone number +14252000004 is found to have the desired number prefix and is reserved for purchase.

Example 3

PS C:\> $orderId = New-CsOnlineTelephoneNumberOrder -Name "Example 3" -Description "Area code selection search example" -Country "US" -NumberType "ConferenceTollFree" -Quantity 1 -AreaCode 800
PS C:\> $order = Get-CsOnlineTelephoneNumberOrder -OrderId $orderId

AreaCode              :
CivicAddressId        :
CountryCode           : US
CreatedAt             : 8/23/2021 5:43:44 PM
Description           : Area code selection search example
ErrorCode             : NoError
Id                    : 1efd85ca-dd46-41b3-80a0-2e4c5f87c912
InventoryType         : Service
IsManual              : False
Name                  : Example 3
NumberPrefix          :
NumberType            : ConferenceTollFree
Quantity              : 1
ReservationExpiryDate : 8/23/2021 5:59:45 PM
SearchType            : AreaCodeSelection
SendToServiceDesk     : False
Status                : Reserved
TelephoneNumber       : {Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Models.TelephoneNumberSearchResult}

PS C:\> $order.TelephoneNumber

Location      TelephoneNumber
--------      ---------------
Toll Free  +18002000004

This example demonstrates an area code selection based telephone number search. Telephone number +18002000004 is found to have the desired area code and is reserved for purchase.

Parameters

-AreaCode

Specifies the telephone number search order number area code. AreaCode is required for area code selection based search.

Parameter properties

Type:Integer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CivicAddressId

Specifies the telephone number search order civic address. CivicAddressId is required for civic address based search and when RequiresCivicAddress is true for a given NumberType.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Country

Specifies the telephone number search order country/region. Use Get-CsOnlineTelephoneNumberCountry to find the supported countries/regions.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies the telephone number search order description.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the telephone number search order name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NumberPrefix

Specifies the telephone number search order number prefix. NumberPrefix is required for number prefix based search.

Parameter properties

Type:Integer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NumberType

Specifies the telephone number search order number type. Use Get-CsOnlineTelephoneNumberType to find the supported number types.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Quantity

Specifies the telephone number search order quantity. The number of allowed quantity is based on the tenant licenses.

Parameter properties

Type:Integer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.