Quick answer: after Connect-ExchangeOnline, run Set-UnifiedGroup -Identity "Marketing" -<Setting> <Value> to change a Microsoft 365 group's mail settings: privacy (-AccessType Private), visibility (-HiddenFromAddressListsEnabled $true), external senders (-RequireSenderAuthenticationEnabled $false), addresses and welcome emails. Set-UnifiedGroup doesn't change members or owners. Use Add-UnifiedGroupLinks for that.
What is Set-UnifiedGroup?
Set-UnifiedGroup changes the properties of an existing Microsoft 365 group (the group behind a team's shared inbox, calendar and files) in Exchange Online PowerShell. It works only in Exchange Online.
| Task | Cmdlet |
|---|---|
| Change settings | Set-UnifiedGroup |
| See settings | Get-UnifiedGroup |
| Add or remove members, owners, subscribers | Add-UnifiedGroupLinks, Remove-UnifiedGroupLinks |
| Change a classic distribution list | Set-DistributionGroup |
How do I connect?
Install-Module ExchangeOnlineManagement -Scope CurrentUser
Connect-ExchangeOnline -UserPrincipalName admin@contoso.com
See installing the Exchange Online module if the cmdlet isn't recognized.
Which settings can I change?
| Goal | Command |
|---|---|
| Make a group private | Set-UnifiedGroup -Identity "Legal" -AccessType Private |
| Allow external senders | Set-UnifiedGroup -Identity "Support" -RequireSenderAuthenticationEnabled $false |
| Hide from the address book | Set-UnifiedGroup -Identity "Project X" -HiddenFromAddressListsEnabled $true |
| Hide from Outlook entirely | Set-UnifiedGroup -Identity "Project X" -HiddenFromExchangeClientsEnabled |
| Stop welcome emails | Set-UnifiedGroup -Identity "All Staff" -UnifiedGroupWelcomeMessageEnabled:$false |
| Subscribe new members to the inbox | Set-UnifiedGroup -Identity "Sales" -AutoSubscribeNewMembers |
| Rename | Set-UnifiedGroup -Identity "Sales" -DisplayName "Sales EMEA" |
| Restrict who can email it | Set-UnifiedGroup -Identity "Board" -AcceptMessagesOnlyFromSendersOrMembers "ceo@contoso.com" |
| Add a MailTip | Set-UnifiedGroup -Identity "Support" -MailTip "Replies within one business day" |
Microsoft's own example changes the address and opens the group to outside mail in one call:
Set-UnifiedGroup -Identity "Marketing Department" -PrimarySmtpAddress marketing@contoso.com -RequireSenderAuthenticationEnabled $false
Why does a switch need :$false?
Several settings are switches, not true/false parameters: HiddenFromExchangeClientsEnabled, UnifiedGroupWelcomeMessageEnabled, AutoSubscribeNewMembers, AlwaysSubscribeMembersToCalendarEvents and SubscriptionEnabled. Name the switch alone to turn it on. Turn it off with a colon and no space: -UnifiedGroupWelcomeMessageEnabled:$false. -UnifiedGroupWelcomeMessageEnabled $false (with a space) fails.
Public vs private: what changes?
- Public: anyone in the organization can join without approval.
- Private: an owner must approve each join.
Either way, anyone can still email a private group. Use -RequireSenderAuthenticationEnabled or -AcceptMessagesOnlyFromSendersOrMembers to limit senders.
How do I add or remove an email address?
-EmailAddresses overwrites the full list unless you use Add and Remove:
Set-UnifiedGroup -Identity "Marketing" -EmailAddresses @{Add="smtp:mktg@contoso.com"}
Set-UnifiedGroup -Identity "Marketing" -EmailAddresses @{Remove="smtp:old-mktg@contoso.com"}
Uppercase SMTP: marks the primary address; lowercase smtp: is an alias. To change only the primary, -PrimarySmtpAddress is simpler.
Hide a group: address lists or Exchange clients?
| Setting | Address book | Outlook left navigation | Still receives mail |
|---|---|---|---|
-HiddenFromAddressListsEnabled $true |
Hidden | Shown to members | Yes |
-HiddenFromExchangeClientsEnabled |
Hidden | Hidden | Yes |
Undo with -HiddenFromExchangeClientsEnabled:$false.
How do I change members or owners?
Add-UnifiedGroupLinks -Identity "Sales" -LinkType Members -Links "chris@contoso.com"
Add-UnifiedGroupLinks -Identity "Sales" -LinkType Owners -Links "chris@contoso.com"
Remove-UnifiedGroupLinks -Identity "Sales" -LinkType Members -Links "chris@contoso.com" -Confirm:$false
How do I check the result?
Get-UnifiedGroup -Identity "Sales" | Format-List DisplayName, AccessType, PrimarySmtpAddress, HiddenFromAddressListsEnabled, HiddenFromExchangeClientsEnabled, RequireSenderAuthenticationEnabled
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Set-UnifiedGroup is not recognized" | Not connected to Exchange Online | Run Connect-ExchangeOnline |
| "A positional parameter cannot be found" on a switch | Space before $false |
Use -Switch:$false |
| Old addresses vanished | -EmailAddresses overwrote the list |
Use @{Add=...} and @{Remove=...} |
| Can't change hidden membership | HiddenGroupMembershipEnabled is set only at creation | Create a new group with New-UnifiedGroup |
| External email bounces | Group accepts internal senders only | -RequireSenderAuthenticationEnabled $false |
-SubscriptionEnabled:$false fails |
AutoSubscribeNewMembers is still on | Set -AutoSubscribeNewMembers:$false first |
| Couldn't find object | Identity matches no group, or more than one | Use the group's email address |
Summary
- Set-UnifiedGroup changes Microsoft 365 group settings in Exchange Online.
- Switches turn off with
:$false, no space. - Use
@{Add=...}to keep existing addresses. - Members and owners use Add-UnifiedGroupLinks.
- Check with Get-UnifiedGroup | Format-List.
Related: Set-DistributionGroup, Get-MgGroup, Get-MgGroupMember.
Meeting Room 365 turns any iPad or Android tablet into a room display for Exchange and Microsoft 365 calendars. See the features or pricing: $9 a display a month.