Integrating Lync Server 2013 and Exchange 2013 is usually a relative straight forward process. We just need to follow the steps described here:
Integrating Microsoft Lync Server 2013 and Microsoft Exchange Server 2013
https://technet.microsoft.com/library/jj688098.aspx
One of these steps is to run the script Configure-EnterprisePartnerApplication.ps1 on a Exchange PowerShell. This script will create a User and the Lync Server partner application for Exchange.
“C:\Program Files\Microsoft\Exchange Server\V15\Scripts\Configure-EnterprisePartnerApplication.ps1 -AuthMetaDataUrl ‘https://<LyncPool>/metadata/json/1′ -ApplicationType Lync”
In a recent deployment, we encountered the following error:
For some reason, the domain Domain 1 was added as Accept Domain in Exchange Server, so the script was trying to use that to create the account.
We have 2 options: either remove Domain 1 as accepted domain from Exchange Server, or manually create the account and run the script again.
$user = New-MailUser -Name LyncEnterprise-ApplicationAccount -ExternalEmailAddress LyncEnterprise-ApplicationAccount@<valid accepted domain>
Set-MailUser -Identity $user.Identity -HiddenFromAddressListsEnabled $true;
Now we can run again the script. This time, however, the script will use the account (LyncEnterprise-ApplicationAccount) we have just created:
If the script executes without errors, we get The configuration has succeeded message. That being so, we may continue with the Lync Server 2013 and Exchange Server 2013 integration steps.