Install Lync and Exchange IM Integration with Multiple Exchange Servers on One Exchange Server

Lync and Exchange IM Integration with Multiple Exchange Servers

This article covers the Instant Messaging (IM) integration configuration between Lync Server 2010 and Exchange Server 2010 SP2.  I  have 2 Exchange Servers one in the US and the other in EMEA and only wanted to implement in the US.  I could not find a tutorial on how to only publish to one site so I hope this can help.


  1. Install the prerequisite software and associated hotfixes on the Exchange server.
  2. Enable various instant messaging settings on the Exchange Client Access service.
  3. Define a new Trusted Application Pool and configure the Trusted Application in Lync Server.


1.  Install Prerequisite Software (MUST BE INSTALLED IN THE ORDER BELOW)

The first component to install is the Microsoft Office Communications Server 2007 R2 Web Service Provider which contains the necessary components to add basic IM and presence features into Outlook Web App.

  • Download and install the CWAOWASSPMain.msi installation package on the Exchange Server where the Client Access Server role is running (e.g.  Select the default installation location as this package will only unpack the installation files and then drop them in the directory shown, it does not perform any component installation.

Lync Exchange Integration 1

  • Browse to the newly created directory (e.g. “c:web service provider installer package”) and run the vcredist_x64.exepackage to install Visual C++2008.  This component may already be installed if the UM integration was previously configured on this Exchange Server.

Next is the Unified Communications Managed API 2.0 Hotfix (KB 2400399) which installs the latest updates for the UC Managed API.  Although this component is included in the unpacked Web Service Provider install directory a newer version needs to be used.


  • Download and install the UcmaRedist.msp patch on the Exchange Server.  Using the Programs and Features control panel verify the installed version is at least 3.5.6907.215.  This component may also already be installed if UM integration is already configured.

Lync Exchange Integration 2

Now the Web Service Provider components can be installed.


  • Browse to the newly created directory (e.g. “c:web service provider installer package”) and execute theCWAOWASSP.msi package on the Exchange Server.  The installation is nearly silent and only a brief status window will appear.  Since no confirmation window appears the installation should be validated by using the Programs and Features control panel verify the installed version is at least 3.5.6907.57.  (Make sure not to mistake the Installer Package as it also appears in the list with the same version; there should be two similar lines.)


  • Lync Exchange Integration 3

The next component needed is the OCS 2007 R2 Web Service Provider Hotfix (KB 981256) which updates the Web Service Provider with the latest hotfixes. Take note that although the file name of this patch appears identical to the original installation file extracted in an early step the patch is not all-inclusive (notice .msi versus .msp)

  • Download and install the CWAOWASSP.msp patch on the Exchange Server.  The version number should now be incremented to 3.5.6907.202.
  • Lync Exchange Integration 4

2. Configure Exchange Server

The Client Access Server configuration is performed using the Exchange Management Shell with a set of PowerShell cmdlets used to identify the current certificate and then populate the various InstantMessaging parameters.

The initial step is identify the certificate currently assigned to the IIS service in Exchange and record the thumbprint value.

  • Display a list of installed certificates and their enabled services by using the following cmdlet.  Copy the Thumbprintvalue for the certificate enabled for the Internal CAS service.

Get-ExchangeCertificate|fl Services,Thumbprint

Lync Exchange Integration 5

  • You may need to open up the MMC console and look at the computer certificateLync Exchange Integration 6-1
  • To make sure that only a single OWA Virtual Directory is currently configured on the Exchange Server (which is the default) execute the Get-OWaVirtualDirectory cmdlet and verify that the only returned result is owa (Default Web site).


Lync Exchange Integration 6

This is where I could not find a solution on having 2 different Exchange Servers and applying only to 1

Get-OwaVirtualDirectory | Set-OwaVirtualDirectory  -identity “EXCHANGESERVER\owa (Default Web Site)” -InstantMessagingType OCS -InstantMessagingEnabled:$true –InstantMessagingCertificateThumbprint THIS IS THE CAS SERVER THUMBPRINT -InstantMessagingServerName

Perform an iisreset on the Exchange Server where the changes where applied to force and update of the IIS metbase and service.  If this is a live environment then the /noforce option should be added to prevent dropping any active client connections.

Lync Exchange Integration 7

3. Configure Lync Server

Now we need to configure the Lync 2010 server.  Use the Lync Server Topology Builder to add a new Trusted Application Pool, as follows:
  • Open the existing topology.
  • Expand your Lync Server 2010 > your sitename.
  • Right-click Trusted application servers and select New Trusted Application Pool.
  • Enter your CAS server or CAS array’s FQDN in the Pool FQDN field, select Single Computer Pool and click Next.  If you’re using a hardware load balancer with separate VIPs for OWA and MAPI connections, use the FQDN for the OWA (HTTPS) connections.
  • Select the Front End Pool for the Trusted Application Pool.
  • Click Finish.
  • Right-click the new Trusted Application Server and select Edit Properties.
  • Clear the check box for Enable replication of configuration data to this pool and click OK.

    Lync Exchange Integration 8

Publish the new topology.

The next step in the configuration is to use the New-CsTrustedApplication cmdlet to define a trusted application and associate it to the new trusted application pool.

Before configuring the trusted application an open listening port on the Lync Server must be selected.  Any unused port can be selected and in this example 5059 was chosen in an effort to keep it mathematically close to the other Lync Server related ports.  If no output is shown in the command then that indicates the port is not currently used as a source listening port, nor are any connections established to foreign hosts using that as a destination port either.

Enter the following command on the Lync Server to search for any current usage of the desired TCP port.

netstat -a | findstr 5058

  • Use the following New-CsTrustedApplication cmdlet to create the trusted application and associate it with the new trusted application pool.  (The ApplicationID value can be any desired string such as it is unique to the trusted application pool.)

New-CsTrustedApplication -ApplicationId ExchangeOWA -TrustedApplicationPoolFqdn -port 5058

After running this is what you should see 

WARNING: The following changes must be made in order for the operation to be complete.

Enable-CsTopology must still be run for all changes to take effect.
Identity               :
ComputerGruus              :                             com;gruu;opaque=srvr:exchangeowa:zluL1yQ-Cw0mk-mSgAA}
ServiceGruu                :;gruu;opaque=srvr                            :exchangeowa:zluL1xka0mk-mSgAA
Protocol                   : Mtls
ApplicationId              : urn:application:exchangeowa
TrustedApplicationPoolFqdn :
Port                       : 5058
LegacyApplicationName      : exchangeowa

As instructed by the previous command issue the Enable-CsTopology cmdlet to apply the latest configuration changes.  The -v switch (for verbose) can be used to display the command progress as well as the location of the output log file.

Enable-CsTopology -v

VERBOSE: Creating new log file

VERBOSE: Activate new or updated services in the topology.
VERBOSE: No changes were made to the Central Management Store.
VERBOSE: Creating new log file
VERBOSE: “Enable-CsTopology” processing has completed successfully.
VERBOSE: Detailed results can be found at

4. Verify Integration

At this point the integration should be fully functional and can be verified by logging into Outlook Web App with a Lync-enabled and mailbox-enabled user account.

4 Replies to “Install Lync and Exchange IM Integration with Multiple Exchange Servers on One Exchange Server”

        1. You can have SP1 installed in your Exchange environment but I have had issues in the past that was resolved when SP2 was installed. If you don’t want to install SP2 and would like to try it with SP1 it should be ok but if you encounter any issues I would recommend going with SP2.

Leave a Reply

Your email address will not be published. Required fields are marked *