Creating an Impersonated Account to Setup MS Exchange Server to 3CX Phonebook Synchronization

In order to synchronize the 3CX Company Phonebook with Microsoft Exchange Server 2013 SP1 and Office 365, an impersonated Microsoft Exchange user account needs to be created. This impersonated account will be used to perform tasks on behalf of the user. In this case the impersonated account credentials will be used by the 3CX Exchange Service to log on to the Microsoft Exchange Server 2013 SP1 or Office 365 and synchronize your Microsoft Exchange contacts with the 3CX Company Phonebook. This feature requires the use of 3CX Phone System Pro.

Note: This is a necessary procedure if you want to synchronize the 3CX Company Phonebook with Microsoft Exchange Server 2013 Service Pack 1 and Office 365.

Attention: If an Exchange Personal Mailbox has more than one contact folder in it’s account, only the default contact folder created by MS Exchange is synchronized. Additional contact folders within this mailbox are not subjected to synchronization. The method used to find the user’s contacts is documented in MSDN under the EWS Managed API for WellKnowFolderName.Contacts

Setup your Impersonated Account with MS Exchange Server (2013 SP1) and Office 365

  1. Open your Exchange Server and log in with an administrator account.
  2. Navigate to recipients -> mailboxes.
  3. Create a new mailbox in your forest with the following details:
    • First name: 3CX.
    • Last name: Exchange Connector.
    • Alias: 3CX.
    • User logon name: Choose anything that you may prefer but remember this one for later.
    • Password: Feel free to choose anything again but also remember this one for later.

  4. Uncheck the option “Require password change on next logon”.  You may extend the AD setting for this user, so that the password never expires.
  5. Navigate to permissions -> admin roles.
  6. Add (using the + symbol) a new admin role policy with the following details:
    • Name: 3CX Application Impersonation.
    • Description: Allows the 3CX Phone System to sync contacts from Users, Public Folders and GAL.
    • Write Scope: Default.
    • Roles: Add the Role name “ApplicationImpersonation”.
    • Members: Add the User “3CX Exchange Connector”.
  7. Save the settings.
  8. Open the Exchange Server Power Shell.
  9. Run this command assuming the ALIAS of the 3CX Exchange User is = 3CX:
    New-ManagementRoleAssignment –Name:3CXApplicationImpersonation –Role:ApplicationImpersonation –User:3CX

Liked this article?


Get notified of new articles
or share
You might also be interested in:
  1. Mahomed

    Interesting article. It would probably be a bit more useful if you started off explaining WHY 3CX requires the Impersonated User account (and sorry, but “So it can perform tasks as a user and impersonate them” is not the answer really). What does it achieve once this is setup and will 3CX work if you don’t do this or if you don’t run Exchange?

    September 3, 2013 at 9:54 am
    • Andreas Psyllos

      Hi Mahomed

      The impersonated account is used in conjunction with Exchange for the Company Directory Sync. Yes 3CX will work without any problems if you don’t do this and you don’t run exchange. Please let us know if you have any further inquiries and thank you for your comments.
      Best Regards

      September 3, 2013 at 10:15 am
  2. Craig

    If I use server serverfqdn/owa I get this error:
    Error while downloading contacts from Public Folders. Message: Exchange Server doesn’t support the requested version., StackTrace: at _3CXCompanyDirectoryService.Business.Clients.EWSPublicFolderClient.GetContactsFromPublicFolder(Int32 id, List`1 phoneNumberTypes, String restrictedCharacters, String PublicFolder, String ConvertPlusTo, List`1 Transl)
    at _3CXCompanyDirectoryService.SchedulerJob.GetNewPublicContacts(String PublicFolder), Source: 3CXCompanyDirectoryService.Business

    If I use server serverfqdn I get this error:
    Error while downloading contacts from Public Folders. Message: The request failed. The remote server returned an error: (405) Method Not Allowed., StackTrace: at _3CXCompanyDirectoryService.Business.Clients.EWSPublicFolderClient.GetContactsFromPublicFolder(Int32 id, List`1 phoneNumberTypes, String restrictedCharacters, String PublicFolder, String ConvertPlusTo, List`1 Transl)
    at _3CXCompanyDirectoryService.SchedulerJob.GetNewPublicContacts(String PublicFolder), Source: 3CXCompanyDirectoryService.Business || InnerException -> Message: The remote server returned an error: (405) Method Not Allowed., StackTrace: at System.Net.HttpWebRequest.GetResponse()
    at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request), Source: System

    Any suggestions? Exchange 2007. Public folders are accessible to the 3cx logging into webmail.

    September 3, 2013 at 7:20 pm
    • Andreas Psyllos

      Hi Craig,

      For the first section it seems like you have not selected the correct Exchange Server version. Please open your management console and go to Settings>> Advanced >> Company Directory Sync tab and from the “Select MS Exchange Version” drop down menu, select Exchange Server 2007 and that should solve your problem. Please let me know if your issue has been resolved and feel free to let us know if you have any further inquiries.

      Best Regards

      September 4, 2013 at 9:17 am
  3. Craig

    Andreas thanks for the response.
    I have Exchange 2007 selected as is my server.
    I have the FREE 2 call license installed in my lab.

    September 4, 2013 at 6:17 pm
    • Andreas Psyllos

      Hi Craig,

      The last comment seems to be what has specified the error this feature requires the use of 3CX Phone System Pro. It is also specified in the post. It will not work on the 3CX demo licence that is why you are having problems with it. Please let us know if you have any further questions or inquiries.

      Best Regards

      September 4, 2013 at 6:57 pm
  4. craig

    just noticed though, that the server log has a line that say “ExchangeServerVersion: Exchange2010” – even though I am set to 2007.

    When I set my server to Exchange 2010 in the settings, the server log shows “ExchangeServerVersion: Exchange2010_SP1”

    When I set my server to Exchange 2010 SP1 in the settings, the server log shows “ExchangeServerVersion: Exchange2010_SP2”

    When I set my server to Exchange 2013 in the settings, the server log shows “ExchangeServerVersion: Exchange2013”

    There does not appear to eb an Option for Exchange 2007.

    September 4, 2013 at 6:22 pm
  5. Craig

    I started a post about this. It does work with the demo license (with comes up as pro erosion).
    Exchange 2007 although an option is mislabeled.
    The software shows
    2007
    2010
    2010 sp1
    2013

    The backed sees
    2010
    2010 sp1
    2010 sp2
    2013

    This is the problem. And if you edit the XML config file and set server type to 0 it works.

    But it doesn’t map the nu bets to the fields properly for me. All numbers end up in same column – which means each contact is getting multiple lines.

    September 5, 2013 at 5:04 pm
  6. Keith

    3CX server event log does show Exchange 2010 when 2007 is selected. I’m on Pro version. Complete restart of 3CX and same issue. The xml file looks correct but underlying code is not apparently.

    1

    September 13, 2013 at 3:11 am
    • Andreas Psyllos

      Hi Keith,

      we are aware of the issue and this will be taken care of in the next update. Thank you for your feedback and please let us know if you have any further questions.

      Best Regards

      September 13, 2013 at 9:35 am