Bearbeiten

Freigeben über


New-CsTeamsTranslationRule

Cmdlet to create a new telephone number manipulation rule.

Syntax

New-CsTeamsTranslationRule
   [-Identity] <string>
   [-Description <string>]
   [-Pattern <string>]
   [-Translation <string>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CsTeamsTranslationRule
   -Name <string>
   [-Description <string>]
   [-Pattern <string>]
   [-Translation <string>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

You can use this cmdlet to create a new number manipulation rule. The rule can be used, for example, in the settings of your SBC (Set-CSOnlinePSTNGateway) to convert a callee or caller number to a desired format before entering or leaving Microsoft Phone System

Examples

Example 1

New-CsTeamsTranslationRule -Identity 'AddPlus1' -Pattern '^(\d{10})$' -Translation '+1$1'

This example creates a rule that adds +1 to any ten digits number. For example, 2065555555 will be translated to +1206555555

Example 2

New-CsTeamsTranslationRule -Identity 'StripPlus1' -Pattern '^\+1(\d{10})$' -Translation '$1'

This example creates a rule that strips +1 from any E.164 eleven digits number. For example, +12065555555 will be translated to 206555555

Example 3

New-CsTeamsTranslationRule -Identity 'AddE164SeattleAreaCode' -Pattern '^(\d{4})$' -Translation '+120655$1'

This example creates a rule that adds +1206555 to any four digits number (converts it to E.164number). For example, 5555 will be translated to +1206555555

Example 4

New-CsTeamsTranslationRule -Identity 'AddSeattleAreaCode' -Pattern '^(\d{4})$' -Translation '425555$1'

This example creates a rule that adds 425555 to any four digits number (converts to non-E.164 ten digits number). For example, 5555 will be translated to 4255555555

Example 5

New-CsTeamsTranslationRule -Identity 'StripE164SeattleAreaCode' -Pattern  '^\+1206555(\d{4})$' -Translation '$1'

This example creates a rule that strips +1206555 from any E.164 ten digits number. For example, +12065555555 will be translated to 5555

Example 6

New-CsTeamsTranslationRule -Identity 'GenerateFullNumber' -Pattern  '^\+1206555(\d{4})$' -Translation '+1206555$1;ext=$1'

This example creates a rule that adds the last four digits of a phone number starting with +1206555 as the extension. For example, +12065551234 will be translated to +12065551234;ext=1234.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

A friendly description of the normalization rule.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Identity

The Identifier of the rule. This parameter is required and later used to assign the rule to the Inbound or Outbound Trunk Normalization policy.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the rule.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Pattern

A regular expression that caller or callee number must match in order for this rule to be applied.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Translation

The regular expression pattern that will be applied to the number to convert it.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Describes what would happen if you executed the command without actually executing the command. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False