“The EdgeSync Cookie has not been updated as expected” | EdgeSync Error

After rebuilding an Exchange 2013 MBX/CAS server in the environment, the Edge Subscriptions were re-created so that the new Exchange server can also participate in the EdgeSync synchronization. Once the Active Directory information was synchronized to AD LDS and mail flow was confirmed to be working, the next step was to make sure that the EdgeSync was working as expected.

Upon running the Test-EdgeSynchronization command the SyncStatus showed as failed with the reason

The EdgeSync Cookie has not been updated as expected. It may indicate EdgeSync has encountered synchronization errors. For more information, check the EdgeSync logs.”

The EdgeSync logs in the Exchange installation folder “\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\EdgeSync” were checked but did not report any issues.

Identified this technet article that discussed on the same issue and as per the article, the synchronization errors are due to stale entries in the ADAM database on the Edge Server. Below are the steps on how to clear these entries from ADSIEdit on the Edge Server:

  1. Login to the Edge Server and execute the command

Type “dsdbutil” and then type “list instances”, keep a note of the output

2. On the Edge Server, launch ADSIEdit.msc and select Connect to. Now, below the ‘Select a well known Naming Context‘ drop down menu select Configuration. Also update the Edge Server name and LDAP port number (50389) from above below Computer section and click OK.

3. Expand Configuration -> Services -> Microsoft Exchange -> First Organization -> Administrative Groups -> Servers -> Edge Server

4. Right click the Edge Server object and locate the attribute msExchEdgeSyncCookies. Remove any old DC values and other stale entries from here. Click OK.

5. Login back to the internal MBX/CAS server and execute the command to start synchronization of Active Directory data to the Edge Server. This will take some time depending on the number of recipient objects in your organization.

Start-EdgeSynchronization -ForceFullSync -ForceUpdateCookie

More explanation on these switches are available here.

6. Now, re-run Test-EdgeSynchronization and make sure that it completed successfully.