For a .pdf version of this help article to download, please see: https://www.peoplehr.com/includes/educate/People_HR_Holiday_Sync_Service.pdf
__________________________________________________________________
1. Introduction
The People HR Holiday Sync Service (HSS) is a tool designed to sync People HR holidays to Exchange server. Currently, it is a one-way sync and supports Exchange 2010, 2013, 2016 and Office 365. It creates and updates existing holidays from People HR into your Exchange Server, and deletes all those holidays, which exist in Exchange server but have been deleted from People HR.
2. User Setup
First you’ll need to build some queries that contain the data you wish to pull through to your Exchange server.
2. 1 Holiday Query:
This query requires the following selected areas:
Once selected, click 'Next' to go into the 'Filters' page. Please refer to the below screenshot on the filter required.
Click 'Next'. This query needs to be called: Holiday : Outlook Feed (DO NOT REMOVE)
2.2 Other Event Query
This query requires the following selected areas:
Once selected, click 'Next' to go into the 'Filters' page. Please refer to the below screenshot on the filter required:
3. Click 'Next'. This query needs to be called: Other Events : Outlook Feed (DO NOT REMOVE)
3. Installation
1. You'll first need to create an API key - this will need to include the Employee endpoint, the access to both the Holiday and other event query you have just built. Click here to learn how to build an API key.
2. Holiday Sync Service (HSS) consists of a Config App, and a Windows Service. Download the tool from the below location: https://peoplehr.sharefile.com/d-s981381565c034cc884324cee1b3f7e87
3. Unzip the file and run the setup.exe.
4. The config App is called ‘Holiday Sync Service Config App’, and 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
5. Click Next, 3 times, to setup at default location. Otherwise, you can modify this to install this to a different location.
6. Now open ‘Holiday Sync Service Config’ app from ‘Start -> People HR location’, and fill in the Exchange Server and the People HR connection details.
Before filling out the other fields, go to the ‘Exchange Version’ field and select what version of exchange you are using. If you select Office 365, the Server and Service URL will auto-populate – you won’t need to edit these.
***
For Office 365 customers, Holiday Sync Service now supports OAuth authentication. OAuth is a modern and more secure way to authenticate connections. Before setting it up to use OAuth for Office 365, the setup steps shown in the below article will need to be completed on Azure Active Directory by a tenant admin.
Office Oauth 365 Setup - Holiday Sync Service Office365 OAuth Setup | People Help Center (peoplehr.com)
***
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.
---
Please Note:
The next set of instructions depend on whether you’re using Office 365 or Exchange 2010, 2013, 2016. Please go to the relevant heading for setting up your Admin on your version of exchange.
---
3.1 Office 365: Setup an Admin user with Permission in Exchange Server:
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.
To do this we will need to make a connection to Exchange Online Powershell, we have included Microsoft help documentation on this below along with our example script to do this.
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Add-MailboxFolderPermission -Identity "EXAMPLE@emailaddress.com:\calendar" -user "EXAMPLE@emailaddress.com" -AccessRights Author
$mailboxes =get-mailbox
Foreach ($mailbox in $mailboxes) {
$calendar =(($mailbox.PrimarySmtpAddress.ToString())+ ":\Calendar") ;
$calendar;
Add-MailboxFolderPermission $calendar -User "EXAMPLE@emailaddress.com" -AccessRights Author
}
Remove-PSSession $Session
3.2 Exchange 2010/2013/2016: Setup an Admin user with Permission in Exchange Server:
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. For this, you need to grant permission on target mailbox user to this Admin mailbox like this: Add-MailboxFolderPermission -Identity user1@domain.com:\calendar -user admin@domain.com -AccessRights Author where admin@domain.com is the Admin mailbox and user1@domain.com is your mailbox with Calendar. To grant calendar permissions for multiple users, like mailbox users from an OU, use following commands: $mailboxes =get-mailbox -OrganizationalUnit ‘OU_Name_Here’; Foreach ($mailbox in $mailboxes) { $calendar = (($mailbox.PrimarySmtpAddress.ToString())+ ":\Calendar") ;$calendar; Add-MailboxFolderPermission $calendar -User admin@domain.com -AccessRights Author} **Note: Be careful and run each of the two commands as one line in Exchange Management Shell.**
---
The next set of instructions are the same for all.
---
After this, you need to start the service. Open Windows Services Manager console. Locate ‘People HR Holiday Manager Service’ and start it. After this, you can monitor the service progress by looking at the log files created by the service. Log files are created inside ‘Logs’ folder at installation path.
3.3 Exchange Holiday Deletion Time Window
To delete non-existing people HR holidays from Exchange Server, the sync service retrieves holidays from your Exchange Server using a time window (start and end times) It then deletes those holidays which exist in Exchange server, but not in People HR 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 exchange server.
4. Troubleshooting
If the holidays from People are not being synced to your exchange server check the log file in the logs folder in your installation path.
If you see the following error “Error occured while checking existence of holiday: Exception occured: The request failed. The remote server returned an error: (401) Unauthorized. IE: The remote server returned an error: (401) Unauthorized.” then please follow these 3 steps:
1. Verify that admin user and password are correct.
2. If service doesn't work with correct credentials, then use ADomain\samAccountName of people HR user as Admin.
3. Please browse EWS service URL in browser, mentioned on config UI, ending in exchange.asmx, and when it asks for user name and password, then enter credentials for people HR user. See if you can view EWS Service XML schema. (If not, then either credentials are invalid or you don’t have EWS API access).
PLEASE NOTE: The refresh rate of this calendar is set at 60 days into the future on a rolling period. As such, the Holiday Sync Service will only look at events up to 60 days in the future at the current time.
Thanks,
Customer Services Team.