Search-CsOnlineTelephoneNumberInventory

 

Topic Last Modified: 2017-03-30

Use the Search-CsOnlineTelephoneNumberInventory cmdlet to reserve telephone numbers that are in inventory and available to be acquired. The quantity you may acquire is displayed within the Skype for Business Admin Center or by executing the Get-CsOnlineTelephoneNumberAvailableCount powershell cmdlet.

Search-CsOnlineTelephoneNumberInventory -Area <String> -CapitalOrMajorCity <String> -CountryOrRegion <String> -InventoryType <String> -Quantity <Int32> -RegionalGroup <String> [-AreaCode <String>] [-BypassDualWrite <$true | $false>] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-TelephoneNumber <String>] [-Tenant <Guid>]

This example reserves 10 Service type telephone numbers in New York, New York.

Search-CsOnlineTelephoneNumberInventory -InventoryType Service -Region NOAM -Country US -Area NY -City NY -Quantity 10

Acquiring tenant telephone numbers is a two step process.

  1. A search must be run to identify and reserve the telephone numbers using the Search-CsOnlineTelephoneNumberInventory cmdlet. The ReservationID and telephone numbers are required input to the second step. Note that we set a variable equal to the return.

    $search = Search-CsOnlineTelephoneNumberInventory -InventoryType Service -Region NOAM -Country US -Area NY -City NY -Quantity 10
    
    RunspaceId    : af39ca40-06a7-473b-8963-668865d15e87
    InventoryId   : Service
    ReservationId : 76ce711f-9da4-46d9-b81d-471172450443
    CreatedOn     : 05/22/2015 17:16:16 +00:00
    ExpiresOn     : 05/22/2015 17:31:16 +00:00
    Reservations  : {Microsoft.Skype.EnterpriseVoice.BVDClient.ReservationResponseItem}
    

    The telephone numbers can be found by using the Numbers member of the Reservations array which is the last item listed in the output example above. Access the numbers as shown in the following example (using the variable created previously).

    $search.Reservations[0].Numbers
    
    Number                                                 DisplayNumber
    ------                                                 -------------
    +12127539058                                           +1 (212) 753 9058
    +12127539059                                           +1 (212) 753 9059
    
  2. Now you can assign the telephone numbers using Select-CsOnlineTelephoneNumberInventory cmdlet. This step requires the ReservationID and the telephone numbers created by Search-CsOnlineTelephoneNumberInventory.

    Select-CsOnlineTelephoneNumberInventory -ReservationId 76ce711f-9da4-46d9-b81d-471172450443 -TelephoneNumbers 12127539058,12127539059 -Region NOAM -Country US  -Area NY -City NY   
    

 

Parameter Required Type Description

Area

Required

System.String

Specifies the target geographical area for the cmdlet. To get a list of geographical codes for areas, use the Get-CsOnlineTelephoneNumberInventoryAreas cmdlet.

CapitalOrMajorCity

Required

System.String

Specifies the target geographical city for the cmdlet. To get a list of geographical codes for cities, use the Get-CsOnlineTelephoneNumberInventoryCities cmdlet.

CountryOrRegion

Required

System.String

Specifies the target country for the cmdlet. To get a list of geographical codes for countries, use the Get-CsOnlineTelephoneNumberInventoryCities cmdlet.

InventoryType

Required

System.String

Specifies the target telephone number type for the cmdlet. Acceptable values are:

  • "Service" for numbers assigned to conferencing support.

  • "Subscriber" for numbers supporting public switched telephone network (PSTN) functions.

Quantity

Required

System.Int32

Specifies the quantity of telephone numbers to reserve. The maximum value is 500.

RegionalGroup

Required

System.String

Specifies the target geographical region for the cmdlet. To get a list of geographical codes for regions, use the Get-CsOnlineTelephoneNumberInventoryRegions cmdlet.

AreaCode

Optional

System.String

Specifies the area code to search for telephone numbers.

BypassDualWrite

Optional

System.Boolean

PARAMVALUE: $true | $false

DomainController

Optional

Microsoft.Rtc.Management.Deploy.Fqdn

This parameter is reserved for internal Microsoft use.

Force

Optional

System.Management.Automation.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 administrative input if required.

TelephoneNumber

Optional

System.String

Specifies either an individual telephone number to reserve, or multiple telephone numbers can be entered separated by a comma.

Tenant

Optional

System.Guid

Specifies your tenant identifier. To find your tenant id use the command: Get-CsTenant | fl objectid.

This cmdlets returns an Microsoft.Rtc.Management.Hosted.Bvd.Types.NumberReservationResponse object.

 
Show: