Disable calendar notifications with Office 365 Groups

The group calendar web part in SharePoint online is fantastic! Traditionally we’ve relied on SharePoint lists to store calendar data in SharePoint. That’s great when i want a list with a bunch of custom metadata fields, but not so great when i want to handle recurring events, outlook integration or make it easy for my users to manage it along with the rest of their meetings.

Scenario Overview

Have a team of leaders who travel all around the world. Want a way to keep them informed about where folks are going to be and who’s out of the office. Want this to be easy for folks to maintain and of course, it needs to work on any device. This is a pretty common scenario so it may sound familiar.

Challenges

This may seem like an obvious fit for Office 365 group calendars. The calendar is hosted as a part of Exchange online and every modern team site / office 365 group comes with a great shared calendar. You can invite the calendar from any email address and your new meeting invite will show up on the calendar. This sounds great. Unfortunately, every member and owner of the office 365 group will be notified by default. Not great when you get emailed a calendar invite for every time someone is out of the office or traveling on your team. Removing their email subscription to the group in powershell or the ui didn’t fix the issue either.

Solution Overview

To work around this, we can change a setting on the group in Exchange Online powershell that automatically subscribes new users to calendar invites. Sadly, we already have a ton of users in our group so we’ll need to remove and silently re-add the users with powershell after making this change. It’s pretty easy .. check out the script below. Let me know if this helps out,

PowerShell

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    #Get GroupID
    Connect-AzureAD

    $group = Get-AzureADGroup -SearchString "Test-IT-Calendar3"

    #connect o exchange online and get the group
    Set-ExecutionPolicy RemoteSigned
    $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

    Get-UnifiedGroup  $group.ObjectId  -IncludeAllProperties | Format-List

    #Set Group to  RequireSenderAuthenticationEnabled $false, dont subscribe new members, and turn off the welcome message
    Set-UnifiedGroup $group.ObjectId -RequireSenderAuthenticationEnabled  $false -AlwaysSubscribeMembersToCalendarEvents:$false -UnifiedGroupWelcomeMessageEnabled:$false

    $owners = Get-UnifiedGroupLinks $group.ObjectId  -LinkType Owner
    
    $members = Get-UnifiedGroupLinks $group.ObjectId  -LinkType Member

    #add service account as member and owner
    Add-UnifiedGroupLinks $group.ObjectId  -LinkType Member -Links $UserCredential.UserName
    Add-UnifiedGroupLinks $group.ObjectId  -LinkType Owner -Links $UserCredential.UserName

    #remove owners
    foreach ($owner in $owners)
    {
        $owner.WindowsLiveID
        Remove-UnifiedGroupLinks $group.ObjectId  -LinkType Owner -Links $owner.WindowsLiveID -Confirm:$false
    }

    #remove members
    foreach ($member in $members)
    {
        $member.WindowsLiveID
        Remove-UnifiedGroupLinks $group.ObjectId  -LinkType Member -Links $owner.WindowsLiveID -Confirm:$false
    }

    #readd members
     foreach ($member in $members)
    {
        $member.WindowsLiveID
        Add-UnifiedGroupLinks $group.ObjectId  -LinkType Member -Links $owner.WindowsLiveID 
    }

    #readd owners
     foreach ($owner in $owners)
    {
        $owner.WindowsLiveID
        Add-UnifiedGroupLinks $group.ObjectId  -LinkType Owner -Links $owner.WindowsLiveID 
    }

    #remove the service account
    Remove-UnifiedGroupLinks $group.ObjectId  -LinkType Owner -Links $UserCredential.UserName -Confirm:$false

     #turn back on the welcome message
    Set-UnifiedGroup $group.ObjectId -RequireSenderAuthenticationEnabled  $false -AlwaysSubscribeMembersToCalendarEvents:$false -UnifiedGroupWelcomeMessageEnabled:$true