Skip to main content

Holiday sync service with Exchange server

Link holidays to Exchange server.

J
Written by Joshua Shooter
Updated over a week ago

With the PeopleHR Holiday Sync Service (HSS) tool, you sync PeopleHR holidays to an Exchange server. Currently, it's a one-way sync and supports Exchange 2010, 2013, and 2016.
โ€‹
This now supports Office365 OAuth, follow the below set up until you reach Step 6, where you can find a link to the set up of this process.


User Setup

Firstly, create two queries containing the data you wish to pull through to your Exchange server.

Holiday query

Create a holiday query with the name Holiday : Outlook Feed (DO NOT REMOVE) using the below fields and filter:

Components

Details

Fields

  • First Name

  • Last Name

  • Work Email

  • Holiday

  • Holiday Start Date

  • Holiday End Date

  • Holiday Type

  • Holiday Duration Type

  • Part of the Day

  • Start Date Part of the Day

  • End Date Part of the Day

  • Holiday Duration (Days)

  • Holiday Duration (Hrs)

  • Holiday Comments

  • Holiday Status

  • Holiday Request Approver

  • Holiday Approved By

  • Holiday Request Date

  • Holiday Last Action Date

  • Holiday Added On

  • Holiday Added By

Filter

In the field list, select Holiday Status, then in the first filter list, select Equals and in the second list, select Approved.

๐Ÿ“ŒNote: For the sync to work correctly, all required fields must be ticked.

Other Event Query

Create a other events query with the name exactly as Other Events : Outlook Feed (DO NOT REMOVE) using the below fields and filter:

Components

Details

Fields

  • First Name

  • Last Name

  • Work Email

  • Other Events

  • Other Event Start Date

  • Other Event End Date

  • Other Event Duration Type

  • Other Events Start Time

  • Other Events End Time

  • Other Events Total Duration (hrs)

  • Other Events Total Duration (days)

  • Other Events Comments

  • Other Events Status

  • Other Events Added on

  • Other Events Added by

  • Other Events Request Date

  • Other Events Added By

  • Other Events Approved By

Filter

In the field list, select Other Events Status, then in the first filter list, select Equals and in the second list, select Approved.


Installation

  1. Create an API key with the Employee endpoint and access to both Holiday : Outlook Feed (DO NOT REMOVE) and Holiday and Other Events : Outlook Feed (DO NOT REMOVE) queries.

  2. Unzip the file and run setup.exe.

    ๐Ÿค“Tip: The config app Holiday Sync Service Config manages all the settings for HSS. It reads and writes all the settings to HolidaySyncService.config file, placed in the installation location, which by default is: C:\Program Files\PeopleHR\Holiday Sync Service

  3. To get to the default location, click Next three times.

    ๐Ÿค“Tip: To install in a different location, modify the default location.

  4. Open the Holiday Sync Service Config app (Oauth set up process).

  5. Select the relevant filters then click Next.

    ๐Ÿค“Tip: If you select Office 365, the Server and Service URL auto populate.

  6. Fill in the Exchange Server and the PeopleHR connection details as follows:

    • Server: Enter Exchange Server IP or Host name (Leave this field if selecting Office 365).

    • Admin: Admin mailbox email address or login ID.

    • Password: Admin mailbox password.

    • Service Url: Read only field, showing Exchange Web Services API endpoint from Exchange Server.

    • TimeZone: Time Zone of your outlook client, or exchange server.

    • Service Interval: A value in minutes, after which service schedule repeats itself to sync the holidays.

    • People API key: Paste your API key in here to retrieve holiday records from People HR system.

    • No of Days in Past.

    • No of Days Ahead.

  7. Click Save.


Set the admin on your exchange version

Depending on whether youโ€™re using Office 365 or Exchange 2010, 2013, 2016, follow the steps in the table below corresponding to your exchange version:

Exhange version

Details

Exchange 2010
Exchange 2013
Exchange 2016

On the Exchange server side, you need to use an admin mailbox user, to manage all of your user mailbox calendars. This way, we put in credentials of one user into the tool, to manage all of the users calendar folders.
โ€‹
๐Ÿ“ŒNote: Ensure you run each of the two commands as one line in Exchange Management Shell.
โ€‹
For this, you need to grant permission on target mailbox user to this admin mailbox like below where:

Add-MailboxFolderPermission -Identity [email protected]:\calendar -user [email protected] -AccessRights Author


To grant calendar permissions for multiple users, like mailbox users from an OU, use the following commands:

$mailboxes =get-mailbox -OrganizationalUnit โ€˜OU_Name_Hereโ€™;  Foreach ($mailbox in $mailboxes) { $calendar = (($mailbox.PrimarySmtpAddress.ToString())+ ":\Calendar") ;$calendar; Add-MailboxFolderPermission $calendar -User [email protected] -AccessRights Author}
  1. Open Windows Services Manager console.

  2. Locate People HR Holiday Manager Service and start it.

  3. After this, to monitor the service progress, look at the log files created by the service.

๐Ÿค“Tip: Log files are created inside Logs folder at the installation path.

Exchange holiday deletion time window

o delete non-existing holidays from Exchange Server, the sync service retrieves holidays from your Exchange Server using a time window then deletes those holidays which exist in Exchange server, but not in PeopleHR system:

  • No. Of Days in Past: This is used to create Start date to retrieve the holidays from exchange server.

  • No. Of Days Ahead: This is used to create End date to retrieve the holidays from the exchange server.

๐Ÿ“ŒNote: Microsoft no longer supports basic authentication. You should be using OAuth.

Did this answer your question?