Search-CsOnlineTelephoneNumberInventory

 

上次修改主題的時間:2017-06-20

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>] [-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

指定 Cmdlet 的目標地理區域。若要取得區域的地理代碼的清單,請使用 Get-CsOnlineTelephoneNumberInventoryAreas Cmdlet。

CapitalOrMajorCity

Required

System.String

指定 Cmdlet 的目標地理城市。若要取得城市的地理代碼的清單,請使用 Get-CsOnlineTelephoneNumberInventoryCities Cmdlet。

CountryOrRegion

Required

System.String

指定 Cmdlet 的目標國家/地區。若要取得國家/地區的地理代碼的清單,請使用 Get-CsOnlineTelephoneNumberInventoryCities Cmdlet。

InventoryType

Required

System.String

指定 Cmdlet 的目標電話號碼類型。可接受的值為:

  • 「服務」適用於指派給會議支援的數字。

  • 「訂閱者」適用於支援公用交換電話網路 (PSTN) 功能的號碼。

Quantity

Required

System.Int32

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

RegionalGroup

Required

System.String

指定 Cmdlet 的目標地理地區。若要取得地區的地理代碼的清單,請使用 Get-CsOnlineTelephoneNumberInventoryRegions Cmdlet。

AreaCode

Optional

System.String

Specifies the area code to search for telephone numbers.

DomainController

Optional

Microsoft.Rtc.Management.Deploy.Fqdn

將保留此參數供 Microsoft 內部使用。

Force

Optional

System.Management.Automation.SwitchParameter

Force 參數會指定是否抑制警告和確認訊息。這在撰寫指令碼以抑制互動式提示時可能很有用。如果命令中不提供 Force 參數,您會在必要時看到提示管理員輸入。

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.

BypassDualWrite

Optional

System.Boolean

PARAMVALUE: $true | $false

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

 
顯示: