Get-CsPhoneNumberAssignment

This cmdlet displays information about one or more phone numbers.

Syntax

Get-CsPhoneNumberAssignment
   [-ActivationState <string>]
   [-AssignedPstnTargetId <string>]
   [-CapabilitiesContain <string>]
  	[-CivicAddressId <string>]
   [-IsoCountryCode <string>]
   [-LocationId <string>]
   [-NumberType <string>]
  	[-PstnAssignmentStatus <string>]
   [-Skip <int>]
   [-TelephoneNumber <string>]
   [-TelephoneNumberContain <string>]
  	[-TelephoneNumberGreaterThan <string>]
   [-TelephoneNumberLessThan <string>]
   [-TelephoneNumberStartsWith <string>]
   [-Top <int>]	[<CommonParameters>]

Description

This cmdlet displays information about one or more phone numbers. You can filter the phone numbers to return by using different parameters.

Returned results are sorted by TelephoneNumber in ascending order.

Examples

Example 1

Get-CsPhoneNumberAssignment -TelephoneNumber +14025551234

TelephoneNumber         : +14025551234
NumberType              : CallingPlan
ActivationState         : Activated
AssignedPstnTargetId    : dc13d97b-7897-494e-bc28-6b469bf7a70e
Capability              : {UserAssignment}
City                    : Omaha
CivicAddressId          : 703b30e5-dbdd-4132-9809-4c6160a6acc7
IsoCountryCode          : US
IsoSubdivision          : Nebraska
LocationId              : 407c17ae-8c41-431e-894a-38787c682f68
LocationUpdateSupported : True
PortInOrderStatus       : 
PstnAssignmentStatus    : UserAssigned
PstnPartnerId           : 7fc2f2eb-89aa-41d7-93de-73d015d22ff0
PstnPartnerName         : Microsoft

This example displays information about the Microsoft Calling Plan subscriber phone number +1 (402) 555-1234. You can see that it is assigned to a user.

Example 2

Get-CsPhoneNumberAssignment -TelephoneNumber "+12065551000;ext=524"

TelephoneNumber         : +12065551000;ext=524
NumberType              : DirectRouting
ActivationState         : Activated
AssignedPstnTargetId    : 2713551e-ed63-415d-9175-fc4ff825a0be
Capability              : {ConferenceAssignment, VoiceApplicationAssignment, UserAssignment}
City                    : 
CivicAddressId          : 00000000-0000-0000-0000-000000000000
IsoCountryCode          : 
IsoSubdivision          : 
LocationId              : 00000000-0000-0000-0000-000000000000
LocationUpdateSupported : True
PortInOrderStatus       : 
PstnAssignmentStatus    : UserAssigned
PstnPartnerId           : 
PstnPartnerName         :

This example displays information about the Direct Routing phone number +1 (206) 555-1000;ext=524. You can see that it is assigned to a user.

Example 3

Get-CsPhoneNumberAssignment -CapabilitiesContain "VoiceApplicationAssignment,ConferenceAssignment"

This example returns all phone numbers that have both the capability VoiceApplicationAssignment and the capability ConferenceAssignment assigned, but phone numbers that have only one of these capabilities assigned won't be returned.

Example 4

Get-CsPhoneNumberAssignment -AssignedPstnTargetId user1@contoso.com

This example returns information about the phone number assigned to user1@contoso.com.

Example 5

Get-CsPhoneNumberAssignment -AssignedPstnTargetId aa1@contoso.com

This example returns information about the phone number assigned to resource account aa1@contoso.com.

Example 6

Get-CsPhoneNumberAssignment -ActivationState Activated -CapabilitiesContain VoiceApplicationAssignment -PstnAssignmentStatus Unassigned

This example returns information about all activated phone numbers with the capability VoiceApplicationAssignment that are not assigned.

Example 7

Get-CsPhoneNumberAssignment -TelephoneNumberContain "524"

This example returns information about all phone numbers that contain the digits 524, including the phone number with extension 524 used in example 2.

Parameters

-ActivationState

Filters the returned results based on the number type. Supported values are Activated, AssignmentPending, AssignmentFailed, UpdatePending, and UpdateFailed.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-AssignedPstnTargetId

Filters the returned results based on the user or resource account ID the phone number is assigned to. Supported values are UserPrincipalName, SIP address, and ObjectId.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-CapabilitiesContain

Filters the returned results based on the capabilities assigned to the phone number. You can specify one or more capabilities delimited by a comma. Supported capabilities

are ConferenceAssignment, VoiceApplicationAssignment, UserAssignment, and OCMobile.

If you specify only one capability, you will get all phone numbers returned that have that capability assigned. If you specify a comma separated list for instance like ConferenceAssignment, VoiceApplicationAssignment you will get all phone numbers that have both capabilities assigned, but you won't get phone numbers that have only VoiceApplicationAssignment or ConferenceAssignment assigned as capability.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-CivicAddressId

Filters the returned results based on the CivicAddressId assigned to the phone number. You can get the CivicAddressId by using Get-CsOnlineLisCivicAddress.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-IsoCountryCode

Filters the returned results based on the ISO 3166-1 Alpha-2 contry code assigned to the phone number.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-LocationId

Filters the returned results based on the LocationId assigned to the phone number. You can get the LocationId by using Get-CsOnlineLisLocation.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-NumberType

Filters the returned results based on the number type. Supported values are DirectRouting, CallingPlan, and OperatorConnect.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-PstnAssignmentStatus

Filters the returned results based on the assignment status. Support values are Unassigned, UserAssigned, ConferenceAssigned, VoiceApplicationAssigned, and ThirdPartyAppAssigned.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-Skip

Skips the first X returned results and the default value is 0.

Type:System.Int32
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TelephoneNumber

Filters the returned results to a specific phone number. It is optional to specify a prefixed "+". The phone number can not have "tel:" prefixed. We support Direct Routing numbers with extensions using the formats +1206555000;ext=1234 or 1206555000;ext=1234.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-TelephoneNumberContain

Filters the returned results based on substring match for the specified string on TelephoneNumber. To search for a number with an extension, you need to specify the digits of the extension. For supported formats see TelephoneNumber.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-TelephoneNumberGreaterThan

Filters the returned results based on greater than match for the specified string on TelephoneNumber. Can be used together with TelephoneNumberLessThan to specify a range of phone numbers to return results for. For supported formats see TelephoneNumber.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-TelephoneNumberLessThan

Filters the returned results based on less than match for the specified string on TelephoneNumber. Can be used together with TelephoneNumberGreaterThan to specify a range of phone numbers to return results for. For supported formats see TelephoneNumber.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-TelephoneNumberStartsWith

Filters the returned results based on starts with string match for the specified string on TelephoneNumber. For supported formats see TelephoneNumber.

Type:System.String
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams
-Top

Returns the first X returned results and the default value is 500.

Type:System.Int32
Position:named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

Inputs

None

Outputs

ActivationState

The activation state of the telephone number.

AssignedPstnTargetId

The ID of the object the phone number is assigned to.

Capability

The list of capabilities assigned to the phone number.

City

The city where the phone number is located.

CivicAddressId

The ID of the CivicAddress assigned to the phone number.

IsoCountryCode

The ISO country code assigned to the phone number.

IsoSubDivision

The subdivision within the country assigned to the phone number, for example, the state for US phone numbers.

LocationId

The ID of the Location assigned to the phone number.

LocationUpdateSupported

Boolean stating if updating of the location assigned to the phone number is allowed.

NumberType

The type of the phone number.

PortInOrderStatus

The status of any port in order covering the phone number.

PstnAssignmentStatus

The assignment status of the phone number.

PstnPartnerId

The ID of the PSTN partner providing the phone number.

PstnPartnerName

The name of the PSTN partner.

TelephoneNumber

The phone number. The number is always displayed with prefixed "+", even if it was not assigned using prefixed "+".

The object returned is of type SkypeTelephoneNumberMgmtCmdletAcquiredTelephoneNumber.

Notes

The cmdlet is available in Teams PowerShell module 4.0.0 or later.

The cmdlet is only available in commercial and GCC cloud instances.