Busines Tutorial NewsEnable multiple Lync user for Enterprice Voice from CSV file

Enable e few users can easily be done from Lync control panel.
But what if you have hundred or maybe thousands of users?
This script will make you life easy and perhaps a bit boring but it works :)
It reads from a csv file and outputs the results to a text file.

This is the script:

########################################################################################################
#
# A script to enable multiple users in a csv file for enterprise voice.
# Created by Kjetil LindL�kken
# http://drlync.blogspot.no/
# The script is  based on this post from Scott Stubberfield and Nick Smith 
# "http://blogs.technet.com/b/nexthop/archive/2010/06/10/scriptassignlineuris.aspx"
# I've added features to enable the users For Enterprice Voice and assign a Voice- and Dial Plan
# Voice Policy and DialPlan can be specified individually in the CSV file 
#
########################################################################################################

param( [string] $importfile = $(Read-Host -prompt `

    "Please enter a file name"))
$importedusers = Import-Csv $importfile

$transcriptname = "AssignLineUri" + (Get-Date `
    -Format s).replace(":","-") +".txt"

Start-Transcript $transcriptname

foreach ($importeduser in $importedusers)
    {
        Set-CsUser $importeduser.SipUri -LineUri `
            $importeduser.LineUri -EnterpriseVoiceEnabled $True �Verbose
Grant-CsDialPlan $importeduser.SipUri `
-PolicyName $importeduser.DialPlan -Verbose
Grant-CsVoicePolicy $importeduser.SipUri `
        -PolicyName $importeduser.VoicePolicy -Verbose


    }

Stop-Transcript

Copy and paste this into notepad and save as i.e. "VoiceEnableUsers.ps1" on your lync server.
Run in Lync Server management shell with administrator rights. .\VoiceEnableUsers.ps1
The script will then ask you to input the file name of you csv file i.e. users.txt

The csv file format looks like this and can be exportet from excel or similar tools:

SipUri,LineUri,DialPlan,VoicePolicy

sip:Abraham.Lincoln@Government.gov,tel:+12024561414,YourDialPlanName,YourVoicePolicyName
sip:Theodore.Roosevelt@Government.gov,tel:+12024561415,YourDialPlanName,YourVoicePolicyName

Hope this will save you some time :)

0 Response to "Busines Tutorial NewsEnable multiple Lync user for Enterprice Voice from CSV file"

Posting Komentar