Select-CsOnlineTelephoneNumberInventory

 

Topic Last Modified: 2016-08-30

Use the Select-CsOnlineTelephoneNumberInventory cmdlet to acquire a list of inventoried telephone numbers and associate them with a Business Voice Directory tenant. The input must be from a telephone number search operation generated by the Search-CsOnlineTelephoneNumberInventory cmdlet.

Select-CsOnlineTelephoneNumberInventory -Area <String> -CapitalOrMajorCity <String> -CountryOrRegion <String> -RegionalGroup <String> -ReservationId <String> -TelephoneNumbers <String[]> [-BypassDualWrite <$true | $false>] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-LocationId <Guid>] [-Tenant <Guid>]

This example assigns two telephone numbers to New York City.

Select-CsOnlineTelephoneNumberInventory -ReservationId 76ce711f-9da4-46d9-b81d-471172450443 -TelephoneNumbers 12127539058,12127539059 -RegionalGroup NOAM -CountryOrRegion US  -Area NY -CapitalOrMajorCity NY   

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 so that we can easily access the telephone numbers embedded in the return.

    $search = Search-CsOnlineTelephoneNumberInventory -InventoryType Service -RegionalGroup NOAM -CountryOrRegion US -Area NY -CapitalOrMajorCity 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 -RegionalGroup NOAM -CountryOrRegion US  -Area NY -CapitalOrMajorCity 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.

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.

ReservationId

Required

System.String

Specifies the telephone number reservation to access. The reservation itself is created by the Search-CsOnlineTelephoneNumberInventory cmdlet.

TelephoneNumbers

Required

System.String[]

Specifies the telephone numbers you wish to assign, separated by commas. The numbers must be in E.164 format.

BypassDualWrite

Optional

System.Boolean

PARAMVALUE: $true | $false

DomainController

Optional

Microsoft.Rtc.Management.Deploy.Fqdn

Specifies the domain controller that's used by the cmdlet to read or write the specified data. Valid inputs for this parameter are either the fully qualified domain name (FQDN) or the computer name.

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.

LocationId

Optional

System.Guid

PARAMVALUE: Guid

Tenant

Optional

System.Guid

Specifies the globally unique identifier (GUID) of your Skype for Business Online tenant account. For example: -Tenant "38aad667-af54-4397-aaa7-e94c79ec2308". You can find your tenant ID by running this command: Get-CsTenant | Select-Object DisplayName, TenantID

This parameter is reserved for internal Microsoft use.

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

 
Show: