How to automatically set calendar publishing range to 12 months (OneYear) for all new mailboxes in Exchange Online?

Noa Saverio De Paola 20 Reputation points
2026-08-25T06:03:39.2533333+00:00

Hi everyone,

By default, published/shared calendars in Exchange Online only show the next 6 months of events. I know I can extend a single mailbox to 12 months using PowerShell:

Set-MailboxCalendarFolder -Identity "******@domain.com:\Calendar" -PublishEnabled $true -PublishDateRangeFrom SixMonths -PublishDateRangeTo OneYear

This is also described in this thread: https://learn.microsoft.com/en-gb/answers/questions/1531591/how-to-view-published-shared-calendar-more-than-6

My question: Is there any way to make this the DEFAULT for newly created mailboxes, so that the publishing range is automatically set to OneYear (12 months) for every new user, without having to run the command manually for each mailbox?

Context: Every year we onboard a group of new users, and we would like their calendars to be visible for 12 months to an external partner tenant (cross-tenant sharing) right from the start, instead of having to remember to run the PowerShell command for each new person.

What I have found so far:

  • There does not seem to be a tenant-wide default setting for PublishDateRangeTo in the Exchange Admin Center or the Microsoft 365 Admin Center.
  • The only options seem to be: (a) run a script periodically against all mailboxes, or (b) include the command in a provisioning/onboarding script.

Is there an officially supported way to enforce a 12-month publishing range as a default for all new mailboxes? Or is a scheduled script / provisioning script the only supported approach?

Thanks in advance for any guidance!

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

0 comments No comments

Answer accepted by question author
Michelle Nguyen 1,180 Reputation points Independent Advisor
2026-08-25T06:24:29.2933333+00:00

Hi @Noa Saverio De Paola

Your understanding is correct. Exchange Online does not currently provide a tenant-wide mailbox policy or organization-level setting that changes PublishDateRangeTo to OneYear automatically for every newly created mailbox.

PublishDateRangeTo is a property of the individual mailbox calendar folder and is configured through Set-MailboxCalendarFolder. The cmdlet documentation does not provide a switch or policy object for setting this value as a default for future mailboxes.

  1. Add Set-MailboxCalendarFolder to your mailbox provisioning or onboarding process.
  2. Run a scheduled PowerShell automation that detects newly created mailboxes and applies the required configuration.
  3. Optionally, run a periodic compliance script against all applicable mailboxes to correct any mailbox that does not have the desired value.

For example:

Connect-ExchangeOnline
Get-EXOMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited |
 ForEach-Object {
 $calendarIdentity = "$($_.PrimarySmtpAddress):\Calendar"
 try {
 Set-MailboxCalendarFolder `
 -Identity $calendarIdentity `
 -PublishEnabled $true `
 -PublishDateRangeFrom SixMonths `
 -PublishDateRangeTo OneYear `
 -ErrorAction Stop
 Write-Host "Updated: $($_.PrimarySmtpAddress)"
 }
 catch {
 Write-Warning "Could not update $($_.PrimarySmtpAddress): $($_.Exception.Message)"
 }
 }

For production automation, it would be better to detect the default calendar folder instead of assuming that its name is always Calendar, because the folder name can be localized according to the mailbox language.

One additional point is that Set-MailboxCalendarFolder controls calendar publishing, such as published calendar URLs. It is not the same as tenant-to-tenant free/busy sharing. Microsoft documents this cmdlet specifically as configuring calendar publishing or sharing settings on an individual mailbox calendar folder.

If the external partner accesses the calendars through an Organization Relationship, sharing policy, or another cross-tenant free/busy configuration, PublishDateRangeTo might not control what they can see. It would therefore be worth confirming whether your implementation uses:

  • Published HTML or ICS calendar URLs, or
  • Exchange organization relationships and free/busy sharing.

Ref: Set-MailboxCalendarFolder

I hope this helps.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.