Thanks!

Populate contacts list in Communicator with LCSAddContacts.WSF

Often, it can be a good idea to pre-populate Communicator (MOC) in an Office Communications Server 2007 R2 before end users start to use MOC. That way they’ll not be met with an “empty” contact list when they log on to MOC. For example, you might want to populate a user’s contact list with a group containing the members of the department the user belongs to. It’s rather easy to use LCSAddContacts.WSF to accomplish this, but I wanted to automate the process based on AD security groups, not only which OU the users/contacts belong to. I am doing all these commands from C:\Program Files\Microsoft Office Communications Server 2007 R2\ResKit\WMI Samples for simplicity.

  1. First, I need to list all the users in the AD Group containing the contacts, using the DN (Distinguished Name) of the group:
    dsget group “CN=SomeGroup,OU=SomeOuAlso,OU=SomeOU,DC=domain,DC=com” -members -expand > members.txt
  2. Then, I need to get the msRTCSIP-PrimaryUserAddress for these contacts:
    for /F “delims=” %x in (‘type members.txt’) do (dsquery * %x –l -attr msRTCSIP -PrimaryUserAddress >> contacts.txt)
    Now I have a list over the contacts that should be populated into the contact list in MOC. The delims= is necessary to read the full lines also if there are spaces. The -l attribute is needed to get only the attribute, not also the name of the attribute for each line. If contacts.txt exists, make sure it’s empty at the script does not overwrite the file, but only appends new lines.
  3. Now I need to get the users that should get these contacts:
    dsget group “CN=SomeOtherGroup,OU=SomeOtherOU,OU=SomeOU,DC=domain,DC=com” -members -expand > userlist.txt
  4. Then, I need to get the msRTCSIP-PrimaryUserAddress for these users:
    for /F “delims=” %x in (‘type userlist.txt’) do (dsquery * %x -l -attr msRTCSIP-PrimaryUserAddress >> users.txt)
  5. Let the magic happen:
    cscript LCSAddContacts.WSF /usersfile:users.txt /contactsfile:contacts.txt /contactsgroup:”My group”

This would be a lot easier if the users and/or the contacts could be picked from a OU (or even manually enter the sip adresseses to users.txt or contacts.txt), but in a real-world scenario you might want to create MOC Contact groups based on AD groups.

Result:

P.S. Existing groups with the same same will not be overwritten, nor will existing contacts in that group. Only new contacts will be added.

OCS 2007 R2 now supports Server 2008 R2

Previously, installing OCS 2007 R2 roles on a server with Windows Server 2008 R2 operating system was not supported. Microsoft has now announced that OCS 2007 R2 finally supports 2008 R2 OS.  It’s worth to note that the Group Chat Server role still does not support 2008 R2. Upgrading an existing installation to Server 2008 R2 is not supported either, so it looks like this support only applies to new OCS 2007 R2 installations.

More info here: http://support.microsoft.com/default.aspx/kb/982021?p=1

It’s also also worth to note that Server 2008 R2 domain also is supported. If you introduce 2008 R2 domain controllers to an existing domain, you’ll have to run forest prep again.

More info here: http://support.microsoft.com/kb/982020

OCS 2007 R2 Create pool error: Unable to access database file location

I was setting up a OCS R2 installation when I got this message when creating the pool:

“Unable to access database file location”. Hmm. The disk and folder I specified was there, no doubt about it. The back-end server and the Front End was on different subnets, so at first I thought this was a firewall problem. The next step was to check if this was a permissions problem – gave my user full access on the SQL server, full control on the database file folders, set my user as local admin, gave the SQL Server service account full control one the catalogs – but no change, still the same error. Continue reading →