In my series about using Lync and Exchange better together, we will in this post, be looking at integrating Lync and Exchange so that we can use Exchange as a unified contact store.
What is Unified Contact store you might ask?
Before we got Lync 2013 and Exchange 2013, both products have there own way of storing the users contacts.
Lync can store contacts in Exchange or actually in Outlook in a Lync Contact folder, which is synchronized, and this sometimes can cause problems if they get out of sync.
But still we have contacts stored both places.
With Unified Contacts Store we only have the Lync contacts stored in Exchange, and not storing them in Lync. For this to work Exchange Web Services must be working and we need to setup a couple of things in Exchange and Lync.
Before we can start you must have a running Exchange 2013 and Lync Server 2013 which is both patched with all the latest patches.
We then need to setup up server-to-server authentication, which you might know as Oauth in Lync. In the installation of Lync you have created a oauth certificate, which is replicated among the lync servers.
With Oauth the servers is not exchanging usernames and password, but instead the authentication is done though tokens which are exchanged though the servers.
First we need to get the autodiscover URL from Exchange which you can find with this cmdlet
Get-ClientAccessServer | fl -Property AutoDiscoverServiceInternalUri
If command is empty in your installation, you will need to define it with Set-ClientAccessServer.
The FQDN name you have in your autodiscover url must be in the certificate that is assigned to Exchange.
On the Lync frontend server you need to define the autodiscover url, but instead of the autodiscover.xml document you must define it as autodiscover.svc
Set-CsOAuthConfiguration -Identity global -ExchangeAutodiscoverUrl https://outlook.exchpro.dk/Autodiscover/autodiscover.svc
Next we need to configure Lync and Exchange as partner applications to each other.
From Exchange this is done though a powershell script which is shipped with Exchange called Configure-EnterprisePartnerApplication.ps1
With this script you tell Exchange the name of the frontend pool, and extend that with /metadata/json/1
Configure-EnterprisePartnerApplication.ps1 -AuthMetaDataUrl ‘https://fe01.exchangepro.local/metadata/json/1′ -ApplicationType Lync
After that run a iisreset on the Exchange Server.
Next we need to do the same from Lync with this command:
New-CsPartnerApplication -Identity Exchange -ApplicationTrustLevel Full -MetadataUrl “https://outlook.exchpro.dk/autodiscover/metadata/json/1″
We have now configured Exchange and Lync as partner for each other, and you can test the connection with this command:
Test-CsExStorageConnectivity -SipUri “sip:firstname.lastname@example.org”
You should see a “Test Passed” – if you do everything works correct.
Normally you are done now and the users contacts will be migrated to Exchange.
The default setting in Lync is that UCSAllowed is set to true in the Global Policy
You could create a new Policy and assign it to a number of users with these cmdlets:
New-CsUserServicesPolicy -Identity “UnifiedContactStore” -UcsAllowed $True
Grant-CsUserServicesPolicy -Identity “joachim” -PolicyName “UnifiedContactStore”
You can check the state of the migration of the contacts with:
Debug-CsUnifiedContactStore -Identity email@example.com |fl
If it says ready to migrate, the contacts will be migrated with in a couple of minutes
And then it will show:
When the contacts has been successful migrated you the users will get a prompt telling them to restart Lync
You can check the migration state on frontend pool with this cmdlet:
Debug-CsUnifiedContactStore -PoolFqdn fe01.exchangepro.local
If you see an error like this:
It could a number of things, but what I most often see is that the Exchange Contact Sync has been disabled in the CsClientPolicy
Enable this with
Set-CsClientPolicy -EnableExchangeContactSync $true
You could also assign a UserServicePolicy to the user to force the migration.
This is it….
Use Lync and Exchange Better together
Other posts in the series:
Voicemail in Office 365: http://exchangepro.dk/2014/01/28/use-lync-and-exchange-better-together-part-3/
Unified Contact Store: http://exchangepro.dk/2014/02/11/use-lync-and-exchange-better-together-part-4/