Tutorial: Managing OCS User Contact lists with LCSAddContacts.WSF

One of the common end user complaints during OCS Deployments is that end users have to manually add contacts to their Communicator 2007 contact list when they are first setup with Communicator. Microsoft has included a tool in the OCS 2007 and OCS 2007 R2 Resource kit for administrators to manage this functionality for individual users or entire Active Directory Containers.

This tool is very simple to use however I have not seen much documentation on it, there are a couple things you will need to gather to run this tool:

  • List of contacts to be added to the user or OU of users contact list
    • This list must be in the form of sip:username@sipdomain.com with each contact separated by a line break
    • You can gather this list through various methods, whether it is LDAP searches using LDP or a 3rd party tool, whatever method you prefer to gather AD user attributes and dump them to a text file. Make sure to clean up the text file so it only contains the SIP:username@sipdomain.com attribute. For reference this attribute in active directory is: msRTCSIP-PrimaryUserAddress
  • List of users or an Active Directory Container of the users whose contact list you wish to manage
    • This must be in the form of sip:username@sipdomain.com or the full CN in the form of DN: OU=OUName DC=Domain,DC=(com,net,etc)
    • If specifying the individual user names you can follow the same methods I mentioned above to gather the text files needed.
  • The OCS 2007 R2 Resource Kit which can be found here: http://www.microsoft.com/downloads/details.aspx?FamilyID=b9bf4f71-fb0b-4de9-962f-c56b70a8aecd&DisplayLang=en

The syntax for the LCSAddContacts.WSF script is: CSCRIPT LCSAddContacts.WSF /usersfile:textfile /contactsfile:textfile /contactsgroup:group to add contacts to [/delete] can be used to remove contacts from the users list

In the below example I will be using a Users file of users.txt and a Contacts file of contacts.txt and a contacts group of Test to be added to my contact list.

This is a users file specifying an Active Directory OU of which I am the only user for testing purposes.

Contacts file with two contacts I will be adding to my group “Test”.

Once you have gathered all of this information the script is very simple to run:

As you can see I executed the script with all files located in the same directory and the output is also shown above. It will provide very clear errors if you have not entered something correctly.

Without signing out of communicator or any action on me as an end point my communicator list was updated with a new group called Test with the two new users in there:

This is a great tool and relieves a lot of end user stress on finding contacts, and also gives greater control over managing user contacts in an OCS environment.


About Randy Wintle

Unified Communications Architect

Posted on July 23, 2009, in Microsoft, OCS, OCS 2007 R2, Unified Communications. Bookmark the permalink. Leave a comment.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: