IT Consultant Everyday Notes

Just some problems/solutions storage

Category Archives: OCS

Lync: How to install CWA on Windows Server 2008 R2 SP1 for Lync integration.

Note: Communicator WEB Access 2007 R2 role is not supported on Windows Server 2008 R2 as per so use the instructions on your own risk. CWA is supported on Server 2008 SP2, you may decide to use that platform.

As you probably know Communicator Web Access (CWA) is not provided with Lync. Microsoft recommends to use Lync integration with Outlook Web Access (OWA) instead. Some people (me included) think this is a bad replacement. In this situation you may need to install CWA in your Lync environment.

In my situation I had a Lync-OCS 2007 RTM coexistence for migration purposes (so AD schema was properly extended for both OCS 2007 RTM and Lync) and CWA installed in OCS environment. CWA worked well for both OCS and Lync users.

Finally migration was completed and I needed to decommission OCS pool. That means CWA will stop to work. Microsoft recommends to reinstall CWA and point it to Lync pool in this situation. Unfortunately CWA for OCS 2007 RTM is not flexible enough to give a list of pools to connect to. CWA for OCS 2007 R2 can do it though. So, I decided to install CWA 2007 R2 to my Lync Monitoring Server (that let me save a server and migrate CWA from Server 2003 to 2008 R2 SP1, standard platform for my environment).

Problem 1: I prepared  IIS as described here and here and  tried to install CWA as it should be normally done (as described for example here) and the attempt was failed – CWA setup could bot find OCS 2007 R2 infrastructure.

Resolution: Rerun OCS forestprep. In my case AD schema was updated when 2008 R2 DC were introduced and that affect OCS settings for some reasons.

After that CWA software was installed, I followed the next step in Deployment Wizard to activate the role, create the web site and Publish it.

Problem 2: All logs were nice and green, but Server never listened for communication from my Lync FE. That’s it – CWA client could send messages, but newer received them! In addition I could not find CWA console Sad smile

Resolution: There are multiple steps. Fist of all I needed to deactivate the installed CWA. Since console was not available I ran a command prompt as Administrator and navigated to <Installation media>\Setup\amd64\setup\cwa There are three files there. I ran cwamain and it deactivated the role uninstalled bits. Next step is install it back. In addition to prerequisites installed before I installed Desktop Experience feature (read to know why). Check installed components: ifs OCS Core Components are not installed you may need to use  Orca MSI editor to edit OCSCore.msi file to drop a condition line (describing OS Version):


Install CWA software again. Update with the latest OCS 2007 R2 patches available here: At this point the System asked for reboot, but I denied and activated CWA. Install Virtual Folders. Publish CWA. Reboot the machine now.

Go to Lync Topology Builder and Merge OCS 2007, OCS 2007 R2 Topology. Microsoft says Lync cannot coexist with both OCS RTM and R2, so I worried if it will work in my case since I had OCS 2007 RTM infrastructure (almost decommissioned) and OCS 2007  R2 CWA. The matter in fact it works!

Last step is “Publish Topology” from Lync Topology Builder.

After that I could successfully connect to my CWA and use it for IM exchange with other Lync Clients.


One problem is without resolution – CWA console is not installed, so it can problematic to change an MTLS certificate (WEB cert can be changed from IIS console).  —   Update: my fault! Forgot you need to install Admin Console separately in OCS 2007 R2 Winking smile

OCS: Last registration time for OCS users

I needed to know when OCS (RTM) users registered with their home server the last time. The goal was to figure out how many “dead” users we have to optimize our licensing. Using this blog as a template I created the following SQL query to run against rtcdyn database:

USE rtcdyn
SELECT rtc.dbo.Resource.UserAtHost, rtcdyn.dbo.HomedUserDynamic.LastNewRegisterTime
FROM rtcdyn.dbo.HomedUserDynamic
INNER JOIN rtc.dbo.Resource on rtc.dbo.Resource.ResourceId = rtcdyn.dbo.HomedUserDynamic.OwnerId

The blog contains queries for OCS 2007 R2 and Lync.