Admin Unsubscribe Users From Microsoft 365 Groups

Neil ChavezPro Tip

Microsoft 365 has a great feature called Microsoft 365 Groups. Microsoft 365 Groups is a membership service that allows users within your organization to collaborate across the Microsoft 365 suite. Microsoft 365 Groups works with the Microsoft 365 tools you already use to create an interface that is ideal for shared projects and group work.  One of the most overlooked features of Microsoft 365 Groups is its shared calendar. When a Microsoft 365 group is created, so too is a Group calendar that group members can view/share appointments. A good use case for this would be creating a “PTO” group for company employees to add their scheduled PTO times against.

By default, users are always subscribed to Microsoft 365 Groups. This means that all group emails and group calendar events will be delivered to both the group mailbox and the user’s mailbox. In most cases, this is a good thing as it informs group members of upcoming appoints, etc. However, there may be use cases where this function may be less than ideal – e.g. cluttering of user’s mailboxes, etc.

While each group member can manually unsubscribe from group emails/calendar events, administrators can leverage PowerShell commands to change this setting for specific 365 groups.

To do this, log in to your Exchange Environment in PowerShell with the Global Admin credentials.

The below command will remove the “Subscribers” link to a specified 365 group for an individual user. This will not remove group membership to the groups. The “Group Name” identity should be changed to the Microsoft 365 Group’s name (mailNickname) & the “user” identity should be changed to the employee’s Microsoft 365 username

Remove-UnifiedGroupLinks -Identity “GroupName” -LinkType Subscribers -Links “user” -Confirm:$false

(*note* that the “-Confirm:$false” flag removes the confirmation prompt for the command)

You can also use the above command in conjunction with the following command to prevent any future group members from being subscribed to that group’s calendar events (again change the “Group Name” identity to the Microsoft 365 group’s name [mailNickname]):

Set-UnifiedGroup -Identity “GroupName” -AlwaysSubscribeMembersToCalendarEvents:$false

For administrators wishing to bulk change this setting for multiple users a PowerShell script can be utilized to do this. Use the info below to create the PowerShell Script:

$Team = “GroupName”

$Members = Get-UnifiedGroupLinks -LinkType Members -Identity $Team

Foreach ($Member in $Members) {

    Remove-UnifiedGroupLinks -LinkType Subscribers -Links $Member.PrimarySmtpAddress -Identity $Team -Confirm:$false

}

(*note* edit the $Team variable to the “mailNickname” of the 365 group you wish to adjust, e.g. $Team = “testgroup”)