There are several administrative uses for manipulating user contacts – the two primary uses are backup & restore, and inserting a standard set of contacts for an organization or department. There are two options available to import and export user contacts which I explain below.
1) Command Line Tool (DBIMPEXP.EXE)
DBIMPEXP.EXE is a little-known tool which can be used export or import a contact list for any user hosted in an OCS Enterprise Pool, or OCS Standard Edition server. The tool is available in one of three places:
- On an OCS 2007 Front-End in the C:\Program Files\Microsoft Office Communications Server 2007\Server\Support directory.
- On an OCS 2007 R2 Front-End in the C:\Program Files\Common Files\Microsoft Office Communications Server 2007 R2\Support directory.
- In the ‘Support’ directory on the OCS 2007 or OCS 2007 R2 installation media.
In the same directory there is a DBIMPexp.exe Readme file that gives good information on usage and a FAQ.
With an Enterprise pool configuration, the big difference on the command line is the need to specify the backend SQL server with the /sqlserver switch. Here are 2 examples of how to use this tool:
- To export the contact list for all users in an Enterprise Pool: dbimpexp.exe /hrxmlfile:contacts.xml /sqlserver:<Pool SQL Hostname>
- To import a contact list for a specific user homed on a Standard Edition server: dbimpexp.exe /hrxmlfile:contacts.xml /user:<sip URL>
2) Using WMI (via a Custom Script or the LCSAddContacts.wsf Resource Kit Tool)
Two WMI class expose user contact information. The MSFT_SIPESUserContactData class specifies a single contact for an Office Communications Server user, and the settings for a contact group are represented by the MSFT_SIPESUserContactGroupData class.
You can use your favorite scripting language (VBScript, Jscript, or Powershell) and write a custom solution, or you can use the Windows Script LCSAddContacts.wsf in the OCS Resource Kit. This resource kit script uses the above mentioned WMI classes and allows programmatic adding of contacts for OCS users.