Table of Contents
Many Ways to Manage Microsoft 365 Groups with PowerShell
A recent question about how to block welcome messages sent when new members join Microsoft 365 groups (Figure 1) sparked a discussion about the best way to create a new group. Of course, there is no best way. The right way depends on the circumstances around the creation of a new group and what you want to achieve.

If all you want to do is to create a new Microsoft 365 group with PowerShell, the easiest method is to run the New-UnifiedGroup cmdlet from the Exchange Online management module. New-UnifiedGroup is the original cmdlet Microsoft developed when they created Office 365 Groups in 2014. It is a compound cmdlet, meaning that it draws information from several Microsoft 365 workloads like Entra ID, Exchange Online, and SharePoint Online. It is a highly effective cmdlet, but New-UnifiedGroup cannot block welcome messages when creating a group. As we’ll see later, the Set-UnifiedGroup cmdlet can block welcome messages for an existing group.
If the new group is to support a team, we can create a group with the New-Team cmdlet from the Microsoft Teams module. The difference between the two cmdlets are the settings applied to the new group. New-UnifiedGroup creates a general-purpose Microsoft 365 group that can be team-enabled if necessary. New-Team creates a new group and then populates the settings to make the group a fully functional team, but it cannot block welcome messages either.
Because Teams has its own communications, New-Team disables some resource behavior options designed for use with email like AutoSubscribeNewMembers and AlwaysSubscribeMembersToCalendarEvents. Although Microsoft designed these settings for use with email-based Outlook groups, they can affect how Teams works. In this case, the settings affect who receives email notifications for channel meetings.
Groups and the Graph
Microsoft 365 administrative interfaces like the Microsoft 365 admin center do not use PowerShell cmdlets to create groups. Instead, they make Graph requests using the Groups API. You can do the same to create a new group by calling the Create Group API and passing a body for the request holding the settings for the new group.
The New-MgGroup cmdlet from the Microsoft Graph PowerShell SDK is based on the Create Group API with many of the settings passed in the request body extracted as separate parameters. This code is an example of running the New-MgGroup cmdlet to create a new Microsoft 365 group (the groupTypes property is set to ‘Unified’):
$Group = New-MgGroup -Description "Electricity Project" -DisplayName "Project members of the Electricity Steering team" -MailEnabled:$True -SecurityEnabled:$False -MailNickname "Electricity.Project" -GroupTypes "Unified"
The New-MgGroup cmdlet is limited to creating Microsoft 365 groups and security groups. It cannot be used to create mail-enabled security groups or distribution lists, even if these objects appear in Entra ID and can be retrieved by the Get-MgGroup cmdlet. These objects essentially belong to Exchange Online. Synchronization replicates the objects to Entra ID and allows management of groups through the Entra ID interfaces. If you need to manage an email-related property, it must be done through Exchange.
Block Welcome Messages for Groups
The New-MgGroup cmdlet can perform tasks that other cmdlets cannot, like marking a group to support role assignments. This brings me back to the original question of disabling the welcome message sent to new group members. There’s no obvious way to do this with the New-UnifiedGroup or New-Team cmdlets, but you can block welcome messages with New-MgGroup.
The trick to disable welcome messages is to set the group provisioning options to include WelcomeEmailDisabled. This setting instructs the Groups service not to send welcome messages as new members join the group. To do this, update the resourceBehaviorOptions property with WelcomeEmailDisabled and pass it to the New-MgGroup cmdlet. Here’s an example of creating a Microsoft 365 group with the welcome message disabled. As new members join the group, the Groups service will note that welcome messages are disabled and stay mute.
$OwnerId = ("https://graph.microsoft.com/v1.0/users/{0}" -f (Get-MgUser -UserId Lotte.Vetler@office365itpros.com).Id ) $NewGroupSettings = @{ "displayName" = "Paris Employees" "mailNickname"= "Paris.Employees" "description" = "Employees working in the Paris region" "owners@odata.bind" = @($OwnerId) "groupTypes" = @("Unified") "mailEnabled" = "true" "securityEnabled" = "false" "ResourceBehaviorOptions" = @("WelcomeEmailDisabled") } $Group = New-MgGroup -BodyParameter $NewGroupSettings
The structure used to pass settings appears complex until you realize that it is composed of a set of arrays and hash tables. The overall structure is a hash table with keys (the settings) and values. Where a setting holds multiple values, it uses an array (like the resource behavior options).
The WelcomeMessageEnabled Property
The discussion so far covers using a resource behavior option to disable welcome messages for groups at the time of creation. The important thing to remember is that these options are immutable. In other words, they can’t be changed. At least, I haven’t found a method to remove the WelcomeEmailDisabled resource behavior option.
Microsoft 365 Groups support another property called WelcomeMessageEnabled, which controls sending welcome messages to new members of Outlook groups. To disable welcome messages for Outlook groups, update this property to $False.
Set-UnifiedGroup -UnifiedGroupWelcomeMessageEnabled:$false -Identity 'Paris Employees'
After a couple of minutes, the updated setting becomes effective. The advantage of this approach is that you can revert the setting to True to allow the flow of welcome messages to resume. Everything works as long as the WelcomeEmailDisabled option is not set for the group. If it is, the resource behavior option takes precedence and Groups ignores the WelcomeMessageEnabled setting.
Learnings
What have we learned from this discussion? The biggest lesson is not to assume that just because one cmdlet can’t do a job, other cmdlets can’t help. The proliferation of PowerShell modules and cmdlets available to Microsoft 365 tenants can be confusing, but I guess choice is better than limitation.
Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365.
Hi Tony, thanks for another interesting article. We noticed that the welcome message in a group was systematically sent by the first owner of the group in alphabetical order. We’ve tried lots of different methods to prevent this but it doesn’t seem possible. We’d also like to know why this happens. After opening a ticket with Microsoft they were unable to answer us. It’s a mystery to us. And since you seem to like mysteries… 🙂
I do like mysteries but I have no idea why this happens. It’s probably because the code retrieves the grouo owners in alphabetical order and chooses the first.