Date: 2025-03-15
Author: Simon Jackson
If you operate Microsoft Teams Phone with Auto Attendants or Call Queues, you eventually encounter a tedious administrative task: maintaining holiday schedules.
Holidays in Microsoft Teams determine how inbound calls behave when an organisation is closed. These schedules can trigger alternate greetings, route calls differently, or direct callers to voicemail. (https://learn.microsoft.com/en-us/microsoftteams/set-up-holidays-in-teams)
In small environments this is manageable. In larger environments it becomes operational overhead.
Every year the same process repeats (gosh this is boring):
Identify the correct public holiday dates
Create date ranges in Teams
Update schedules
Re-attach them to auto attendants or call flows
This quickly becomes repetitive and error-prone. If you want to solve this, and are comfortable with powershell, keep reading...
Microsoft Teams supports defining holiday periods for voice services such as Auto Attendants. These periods can override normal business hours and apply alternate routing or greetings. (https://learn.microsoft.com/en-us/microsoftteams/set-up-holidays-in-teams)
However, managing them manually has several limitations:
Holidays must be entered as date ranges.
Each year requires manual updates.
Organisations operating across regions must track multiple holiday calendars.
The process does not scale well across many call flows.
In environments with dozens of call queues or auto attendants, the maintenance overhead becomes noticeable.
Instead of manually maintaining a static list of holidays, the solution is to retrieve them dynamically from a public API and update the Teams schedule automatically.
The script behind this project performs three tasks:
Retrieve public holiday data from an external REST API.
Clean and prepare the data for Teams schedules.
Create or update the schedule used by Teams voice services.
The end result is a single schedule that always contains the correct public holidays for a given country.
Multiple auto attendants can then reference that single schedule.
This means only one dataset needs to be maintained.
The repository contains a PowerShell module that exposes two primary functions:
New-TeamsPublicHolidays
Update-TeamsPublicHolidays
These functions interact with Microsoft Teams using the MicrosoftTeams PowerShell module.
Before running the script you must install and load the module.
Install the Teams module:
Install-Module MicrosoftTeams
Import the module:
Import-Module MicrosoftTeams
Authenticate to your tenant:
Connect-MicrosoftTeams
Once connected, the script can create or update a schedule based on parameters such as:
ScheduleName
CountryCode
Year (optional)
If the year is not specified, the script defaults to the current year.
Rather than storing static holiday tables, the script retrieves public holiday information from an external API.
This approach provides several advantages:
No need to maintain holiday lists manually.
Accurate data for multiple countries.
Automatic updates when a new year begins.
Because the script fetches data dynamically, the schedule can be regenerated whenever required.
The simplest operational model is to run the script once per year.
However, there are other options:
Run as a scheduled task each year.
Execute via an automation platform.
Integrate into operational runbooks.
Since the script rebuilds or updates the schedule from external data, running it repeatedly is safe.
Voice automation systems rely heavily on accurate schedules. Busineses have set opening hours, and they follow the national holidays set out by the local government/political/religious body. Incorrect holiday definitions can cause problems such as:
Calls reaching staff during shutdown periods
Incorrect greetings being played
Call routing failing during closures
Automating the schedule eliminates these risks.
It also eliminates a small but recurring operational task from the administrator workload.
Microsoft Teams provides the ability to configure holiday schedules for Auto Attendants and call routing, but managing those schedules manually does not scale well. (https://learn.microsoft.com/en-us/microsoftteams/set-up-holidays-in-teams)
A short PowerShell script can automate the entire process.
By retrieving holiday data dynamically and updating Teams schedules automatically, organisations gain:
accurate schedules
less administrative effort
consistent call handling during holidays
If you manage Microsoft Teams voice workloads, this small piece of automation can remove a surprising amount of operational friction.
The full script and examples are available on GitHub.