Monday, 4 August 2014

How to integrate Lync Server 2013 with Exchange Server 2013 Outlook WebApp in 5 easy steps.

For those of you that don't know, I'll begin with a a bit of background.  We all know that Lync integrates with Outlook on the desktop.  This integration adds useful features such as presence indicators in emails, the conversation history folder for searching through old IMs, the ability to search your contacts within Lync and of course the 'New Lync Meeting' button for scheduling Lync meetings.  It relies on the user having a desktop, Outlook set up with the users' mailbox and of course the Lync 2013 client.  It also relies on a bit of back end magic known as Exchange Web Services, but that is for another post.

What do you do if you don't have a permanent desktop with Outlook and Lync and that EWS magic?  What if all you have is a PC in the public foyer of a hotel? 

Well fret not, help is at hand.  

I'm going to go out on a limb and assume a few things.  First of all, this post centres around integration with Exchange 2013, but it also works with Exchange 2010.  So I'll make an assumption that you have either Microsoft Exchange Server 2010 or 2013.  I'll assume that you have provisioned Exchange to be accessible from the public internet.  Otherwise known as the Outlook Web App.  And that you have a public certificate on the Client Access Server enabled with all of the relevant services and most importantly IIS.  I'll also assume you have Lync Server 2013 installed properly and working.  You'll need Lync to be accessible remotely and for that you'll need an Lync Server 2013 Edge server or Edge Pool.  

If you need help with your Exchange server set up talk to Exchange Administrator or your IT Service Provider.  If you need help with Lync talk to the experts at MeetingZone.  Shameless plug done I'll move onto the science.

You will need to use an account with the appropriate permissions on both Exchange server and in Lync.

Step One - Create a Trusted Application Pool in Lync.

In this case we are adding the Exchange server as a Trusted Application Pool in Lync.  On a Lync Front End open the Lync Server Management Shell as an Administrator and run the following:
New-CsTrustedApplicationPool -id -registrar -site "Site:Site Name" -requiresreplication $false
Step Two  - Create Trusted Application - Exchange Outlook Web App
In the same Management Shell run the following:
New-CsTrustedApplication -ApplicationID ExchangeOutlookWebApp -TrustedApplicationPoolFqdn -Port 9999
Now Switch to the Exchange server and open the Exchange Management Shell as an Administrator.

Step 3 - Associate the public certificate installed on Exchange with Lync Instant Messaging.  Run the following:
$cert = (Get-ExchangeCertificate | Where {$_.Services -ilike "*IIS*"}).Thumbprint
Get-OWAVirtualDirectory | Set-OWAVirtualDirectory -InstantMessagingType OCS -InstantMessagingEnabled $true -InstantMessagingCertificateThumbprint $cert –InstantMessagingServerName
Add two keys to the web.config file on the mailbox servers. 
Located in the folder C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Owa). In the <appSettings> section. And obviously with your thumbprint. 
<add key="IMCertificateThumbprint" value="EF5ASDTNJI47JI785JUYHVFTYH87HYGTF87GTNJI667" />
<add key="IMServerName"" />
Step 4 - Recycle the Application Pool
Open the Command Prompt as Administrator.  Browse to c:\Windows\System32\Inetsrv\ and run the following:
Appcmd.exe recycle apppool /"MSExchangeOWAAppPool"
You should see the following:
Result: "MSExchangeOWAAppPool" successfully recycled 
Step 5 - Now set the Mailbox Policies to enable Instant Messaging.  Back to the Exchange Management Shell.  Run the following:
Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -InstantMessagingEnabled $True -InstantMessagingType "OCS"
Now to test.  Open Outlook Web Access.  https:\\ 

In the top right, click on your name and you will see it sign into IM.  Once that is done you should see something like the following:
Here you can set your status and assuming you have rights, change your Photo.

From the People Menu you can see presence indicators for users in your contact list assuming they have Lync and the contact card includes an IM address.

 Clicking on the IM button within a contact starts an IM with that contact.

As you can see, Integrating Lync 2013 with Exchange 2013 is both easy and extremely useful.  Your users will thank you.

Thank you for reading.