Topic Last Modified: 2010-10-01

Returns information about public switched telephone network (PSTN) usage records used in your organization.


Get-CsPstnUsage [-Identity <XdsIdentity>] [-LocalStore <SwitchParameter>]
Get-CsPstnUsage [-Filter <String>] [-LocalStore <SwitchParameter>]


Parameter Required Type Description




The level at which these settings are applied. The only identity that can be applied to PSTN usages is Global.




The Filter parameter allows you to retrieve only those PSTN usages with an Identity matching a particular wildcard string. However, the only Identity available to PSTN usages is Global, so this parameter is not useful for this cmdlet.




Retrieves the PSTN usage information from the local data store rather than the main Central Management store.

Detailed Description

PSTN usages are string values that are used for call authorization. A PSTN usage links a voice policy to a route. The Get-CsPstnUsage cmdlet retrieves the list of all PSTN usages available within an organization.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Get-CsPstnUsage cmdlet locally: RTCUniversalUserAdmins, RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Get-CsPstnUsage"}

Input Types


Return Types

Get-CsPstnUsage returns instances of the Microsoft.Rtc.Management.WritableConfig.Policy.Voice.PSTNUsages object.


-------------------------- Example 1 --------------------------

Copy Code

This command returns the list of global PSTN usages available within the organization.

-------------------------- Example 2 --------------------------

Copy Code

The command in this example returns a list of all defined PSTN usages, with one usage listed on each line of output. Calling Get-CsPstnUsage by itself returns the Identity and the Usage list. If the Usage list contains more than three or four entries, the list will be abbreviated in the output, similar to this:

Usage : {Internal, Local, Long Distance, International...}

Use the command in this example to display only a list of usages. The output will be similar to this:



Long Distance



-------------------------- Example 3 --------------------------

Copy Code
(Get-CsPstnUsage).Usage | ForEach-Object {if ($_ -like "*tern*") {$_}}

This command returns all the PSTN usage names that have the string "tern" somewhere within the name. For example, this command will return "Internal" and "International" but not "Local" or "Long Distance".

The first part of this command is the Get-CsPstnUsage cmdlet within parentheses, which means the first thing that happens is for all the PSTN usages to be retrieved. The .Usage property returns only the usage information for the PSTN usages, not the Identity. This list of usages is then piped to the ForEach-Object cmdlet, which looks at the usage strings one at a time. The If statement compares the current usage string to the string "*tern*" (the * are wildcards) and displays any occurrence that matches that pattern.

See Also