Submitted by Scott Stubberfield and Nick Smith, Microsoft
In order to take advantage of Enterprise Voice (Microsoft’s implementation of Voice over IP) users need, among other things, to be assigned a dial plan and a voice policy. Dial plans and voice policies can easily be assigned to individual users by using Lync Server PowerShell. But is the same thing true when it comes to assigning dial plans and voice policies to
As it turns out, it
true: all you have to do is save the required information (user identity, dial plan name, and voice policy name) in a comma-separated values file and then write a script that reads in that information and assigns the appropriate dial plans and policies.
Check that: you don’t have to write a script to do this. That’s because Scott Stubberfield and Nick Smith have already written such a script for you. Their
script reads a comma-separated values file and then takes each user listed in that file and assigns the user the appropriate dial plan and voice policy. For example, suppose the first user in the file has the following property values:
For this first user (sip:firstname.lastname@example.org) the script will assign the dial plan listed in the DialPlan field and the voice policy listed in the VoicePolicy field. In effect, that means the script will run the following two commands:
To make use of this script, copy the code to Notepad (or any other text editor), and then save the file using a .PS1 file extension (for example, C:ScriptsGrantDialPlanAndVoicePolicy.ps1). In addition, you must create a .CSV file similar to this, and save
file to your hard drive as well:
To run the script from within the Lync Server Management Shell, simply type the full path to the .PS1 file and then press ENTER:
When the script starts, it will prompt you to enter the location of the .CSV file. Type in the file path (e.g., C:ScriptsUsers.csv) and press ENTER; in turn, the script will read the data from the .CSV and then assign each user the appropriate dial plan and voice policy.
As if that isn’t enough, the script also maintains a detailed log of everything it does. That log will be stored in the current working directory, and will have a file name based on the current date and time. For example: