Edit

Share via


New-CsTeamsTranslationRule

Cmdlet to create a new telephone number manipulation rule.

Syntax

Identity (Default)

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

ParentAndRelativeKey

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

A friendly description of the normalization rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(Identity)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(ParentAndRelativeKey)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Pattern

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Translation

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.