Monthly Archives: November 2012

You are browsing the site archives by month.

Import custom contacts into all Lync Users Contact List

On number of occasions I was asked if there is  a way to add certain contact/s to everyone’s Contact List in Lync.Well there isn’t any native Lync cmdlet which can do it. Jeff Guillet has written a script which can do this and works really well.

Here is the alternative script to import the contacts into Lync.The script uses PowerShell & DBIMPEXP .

Requirements:

1)Download the script from here

2)Copy DBIMPEXP into the same folder from where the script is launched. DBIMPEXP can be copied from .\Program Files\Common Files\Microsoft Lync Server 2010\Support”.

3) A template XML file exists in the folder.This is the XML file which contains the contacts you want to import.To generate this file use DBIMPEXP tool. Justin’s blog provides a good overview on this.

4)A TXT file which contains the SIP addresses of the users into whose Lync contact list you want to import new contacts (from the template).

5)For reference you can also download the XML & TXT

6)Make sure to populate variables correctly in the script

7)Have write access to Backend Lync database

Script Workflow:

1) The script grabs the TXT file to enumerates SIP addresses

2) For each SIP address the script will grab the template file and create a XML file for it.So essentially for each user in the TXT file you will have a XML file generated.The script does not automatically delete the XML file.

3) The generated XML file is imported into users Contacts list.The new contacts are appended to users existing Contacts list.

4)A single log file is generated which will log any success/failure of the import process.

I wouldn’t quite recommend to run this very often as this will impact your SQL especially if you have thousands of users but will work quite well if run on ad-hoc basis.