Home > Lync, Uncategorized > Easily Changing CallerIDs for Lync Users

Easily Changing CallerIDs for Lync Users

Background: Suppose you have a customer who has employees, (“agents”) who make various calls during the day but need to have their CallerID changed during the day. This can occur if the Agent is placing calls on behalf of one client in the morning, and on behalf of another in the afternoon. Since each client has a different return number, (i.e. CallerID), it can be useful to have a method of changing a Lync agents’ CallerID. This can be done by creating a Lync Voice Policy, Usage and Route for each different number, (i.e. CallerID). Then you can use the CS-GrantPolicy cmdlet to assign, and re-assign the policy associated with a Lync user to change the CallerID that they present to callers. This can be done by writing a PowerShell script, and then assigning someone permissions to run that script, (e.g. Office Manager, etc.).

The first step is to create, and run a set of PowerShell scripts to create the Lync Policies, Usages and Routes.
Then write a set of scripts that someone can run to change the Voice Policy for a Lync user.

Step 1 example:
Create a PS script file named: cp.ps1 and add the text below.
Run this script with the following parameters: cp .
For example if you want the following:
Lync Policy : MI6-Policy
Lync Usage: MI6-Usage
Lync Route : MI6-Route
CallerID : 2085551234

From a Lync Management Shell run the script below as : cp MI6 2085551234

# cp.ps1
$clientname=$args[0]
$ph=$args[1]

$usage=$ clientname +”-Usage”
$policy=$ clientname +”-Policy”
$route=$ clientname +”-Route”

Set-CsPstnUsage -Identity global -Usage @{add=$usage}
New-CsVoiceRoute -Identity $route -numberpattern “.*” -PstnUsages @{add=$usage} -suppressCallerid $true -alternatecallerid $ph -PstnGatewayList @{add=”PstnGateway:10.0.0.41″}
New-CsVoicePolicy $policy -PstnUsages @{add = $usage}

Step 2 example: Suppose you want AD user MI6\money.penny to start placing calls with a CallerID of 2085551234.
Enter and run the following script as: changepolicy ad\money.penny MI6-Policy

# changepolicy.ps1
$loginname=$args[0]
$policy=$args[1]
Grant-cspolicy -identity $loginname -policyname $policy

By building a collection of the Step 2 scripts you can easily delegate the assignment of CallerIDs to different Lync users/agents.

Hugh Marlor
Principal Consultant – Unified Communications
Dell | GICS Public Services
Lync +1 512 723 3378
Customer feedback | How am I doing? Please contact my manager dustin_johnson@dell.com.

“The pessimist complains about the wind; the optimist expects it to change; the realist adjusts the sails.”

Advertisements
Categories: Lync, Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: