Manage Microsoft 365 Groups with PowerShell - Microsoft 365 Enterprise (2023)

  • Article
  • 6 minutes to read

This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.

This article provides the steps to perform common group management tasks in Microsoft PowerShell. It also lists the PowerShell cmdlets for groups. For information about administering SharePoint sites, seeManage SharePoint Online sites with PowerShell.

Link to your Microsoft 365 Groups Acceptable Use Policy

If userCreate or edit a group in Outlook, you can show them a link to your organization's Acceptable Use Policy. For example, if a specific prefix or suffix should be added to a group name.

Use Azure Active Directory (Azure AD) PowerShell to make your users aware of your organization's usage policies for Microsoft 365 Groups. CashAzure Active Directory cmdlets to configure group settingsand follow the steps in theCreate directory-level settingsto define the Acceptable Use Policy hyperlink. After running the AAD cmdlet, users will see the link to your policies when creating or editing a group in Outlook.

Manage Microsoft 365 Groups with PowerShell - Microsoft 365 Enterprise (1)

Manage Microsoft 365 Groups with PowerShell - Microsoft 365 Enterprise (2)

(Video) Understanding Microsoft 365 Groups with Andy Malone

Allow users to send as a Microsoft 365 group

If you want to enable your Microsoft 365 Groups for Send As, use theAdd Recipient PermissionAndGet-RecipientPermissioncmdlets to configure this. After you enable this setting, users in the Microsoft 365 Group can use Outlook or Outlook on the web to send and reply to email as a Microsoft 365 Group. Users can go to the group, create a new email, and change the Send As field to the group's email address.

(You can also do this in the Exchange admin center.)

Use the following script and replace<group alias>with the alias of the group you want to update and<user alias>with the alias of the user you want to grant permissions to.Connect to Exchange Online PowerShellto run this script.

$groupAlias ​​= "<GroupAlias>"$userAlias ​​= "<UserAlias>"$groupsRecipientDetails = Get-Recipient -RecipientTypeDetails groupmailbox -Identity $groupAliasAdd-RecipientPermission -Identity $groupsRecipientDetails.Name -Trustee $userAlias ​​-AccessRights SendAs

After the cmdlet runs, users can go to Outlook or Outlook on the web to send as a group by adding the group email address to theOut ofFeld.

Create classifications for Microsoft 365 Groups in your organization

You can create sensitivity labels that users in your organization can set when creating a Microsoft 365 group. If you want to classify groups, we recommend using sensitivity labels instead of the previous group classification feature. For information on using sensitivity labels, seeUse sensitivity labels to protect content in Microsoft Teams, Microsoft 365 Groups, and SharePoint sites.

Important

If you currently use classification labels, once sensitivity labels are enabled, those users who create groups will no longer be available.

(Video) Connect to Microsoft 365 using PowerShell

You can still use the previous group classification feature. You can create classifications that users in your organization can set when they create a Microsoft 365 group. For example, you can allow users to set Standard, Secret, and Top Secret for groups they create. Group classifications are not set by default and you must create them for your users to be able to set them. Use Azure Active Directory PowerShell to make your users aware of your organization's usage policies for Microsoft 365 Groups.

BoxAzure Active Directory cmdlets to configure group settingsand follow the steps in theCreate directory-level settingsto define the classification for Microsoft 365 Groups.

$setting["ClassificationList"] = "Low Impact, Medium Impact, High Impact"

To assign a description to each classification, you can use the settings attributeClassification Descriptionsdefine.

$setting["ClassificationDescriptions"] ="classification:description,classification:description"

Where Classification matches the strings in the ClassificationList.

Example:

$setting["ClassificationDescriptions"] = "Low Impact: General Communications, Medium Impact: Corporate Data, High Impact: Data with Regulatory Requirements"

After running the above Azure Active Directory cmdlet to set your classification, run theSet-UnifiedGroupCmdlet if you want to set classification for a specific group.

Set-UnifiedGroup <LowImpactGroup@constoso.com> -Classification <LowImpact>

Or create a new group with a classification.

New-UnifiedGroup <HighImpactGroup@constoso.com> –Classification <HighImpact> –AccessType <Public>

BoxUsing PowerShell with Exchange OnlineAndConnect to Exchange Online PowerShellLearn more about using Exchange Online PowerShell.

(Video) Restrict Users from Creating new Microsoft Teams and Office 365 Groups by using Power shell 2022

Once these settings are enabled, the group owner can select a classification from the drop-down menu in Outlook on the web and Outlook and add it to theEditgroup page.

Manage Microsoft 365 Groups with PowerShell - Microsoft 365 Enterprise (3)

Hide Microsoft 365 Groups from the Global Address List.

You can specify whether a Microsoft 365 group appears in the global address list (GAL) and other lists in your organization. For example, if you have a legal department group that you don't want to appear in the address list, you can prevent that group from appearing in the GAL. Run the Set-Unified Group cmdlet to hide the group from the address list as follows:

Set-UnifiedGroup -Identity "Rechtsabteilung" -HiddenFromAddressListsEnabled $true

Allow only internal users to send messages to Microsoft 365 groups

If you don't want users from other organizations to send email to a Microsoft 365 group, you can change the settings for that group. It only allows internal users to send an email to your group. If an external user tries to send a message to this group, it will be rejected.

Run the Set-UnifiedGroup cmdlet to update this setting as follows:

Set-UnifiedGroup -Identity "Nur interne Absender" -RequireSenderAuthenticationEnabled $true

Add MailTips to Microsoft 365 Groups

Whenever a sender tries to send an email to a Microsoft 365 group, they can see a MailTip.

Run the Set-Unified Group cmdlet to add a mailTip to the group:

Set-UnifiedGroup -Identity "MailTip Group" -MailTip "This group has a MailTip"

Along with MailTip, you can also set MailTipTranslations that specify other languages ​​for the MailTip. Assuming you want the Spanish translation, then run the following command:

(Video) What's NEW & Cool in Microsoft 365 Groups

Set-UnifiedGroup -Identity "MailaTip Group" -MailTip "This group has a MailTip" -MailTipTranslations "@{Add="ES:Esta caja no se supervisa."

Change the Microsoft 365 Group display name

The display name indicates the name of the Microsoft 365 group. You can see that name in yoursExchange Admin CenterorMicrosoft 365 Admin Center. You can edit the group display name or assign a display name to an existing Microsoft 365 group by running the Set-UnifiedGroup command:

Set-UnifiedGroup -Identity "mygroup@contoso.com" -DisplayName "My new group"

Change the default setting of Microsoft 365 Groups for Outlook to Public or Private

Microsoft 365 Groups in Outlook are created as private by default. If your organization wants Microsoft 365 Groups to be created as public by default (or back to private), use this PowerShell cmdlet syntax:

Set-OrganizationConfig -DefaultGroupAccessType Public

To set private:

Set-OrganizationConfig -DefaultGroupAccessType Privat

To check the setting:

Get-OrganizationConfig | ft DefaultGroupAccessType

For more information, seeSet-OrganizationConfigAndGet-OrganizationConfig.

Microsoft 365 Groups Cmdlets

The following cmdlets can be used with Microsoft 365 Groups.

Cmdlet-NameDescription
Get-UnifiedGroup
Use this cmdlet to find existing Microsoft 365 groups and view properties of the group object
Set-UnifiedGroup
Update the properties of a specific Microsoft 365 group
New-UnifiedGroup
Create a new Microsoft 365 Group. This cmdlet provides a minimal set of parameters. To set values ​​for extended properties, use Set-UnifiedGroup after creating the new group
Remove-UnifiedGroup
Delete an existing Microsoft 365 group
Get-UnifiedGroupLinks
Get membership and owner information for a Microsoft 365 group
Add-UnifiedGroupLinks
Add members, owners, and subscribers to an existing Microsoft 365 group
Remove-UnifiedGroupLinks
Remove owners and members from an existing Microsoft 365 group
Get-UserPhoto
Used to display information about the user photo associated with an account. User photos are stored in Active Directory
Set-UserPhoto
Used to associate a user photo with an account. User photos are stored in Active Directory
Remove-UserPhoto
Remove the photo for a Microsoft 365 group

Update distribution lists to Microsoft 365 Groups

Manage who can create Microsoft 365 Groups

(Video) Best Practices and What's New for Managing Office 365 Groups - SPC19

Manage guest access to Microsoft 365 Groups

Change static group membership to dynamic in

FAQs

How do I get a list of Microsoft 365 groups in PowerShell? ›

Use the Get-UnifiedGroup cmdlet to view Microsoft 365 Groups in your cloud-based organization. To view members, owners and subscribers for Microsoft 365 Groups, use the Get-UnifiedGroupLinks cmdlet.

How do I add an O365 group owner in PowerShell? ›

To add a user as an owner of an Office 365 group, we need to add them as a “member” to the group first, and then we have to add the user as an owner. Use the Add-UnifiedGroupLinks cmdlet to add an owner to an Office 365 group using PowerShell. Provide the group's email address and the owner's email address as input.

How do I create a Microsoft 365 group in PowerShell? ›

To create an Office 365 Group, first, you need to establish a remote session to Exchange Online and then use the New-UnifiedGroup cmdlet to create an Office 365 Group with PowerShell. This creates a new private group called “Consumers Group” with an email address of “ConsumersGroup@Crescent.com”.

How do I see all groups in PowerShell? ›

To get the local groups on the windows system using PowerShell, you can use the Get-LocalGroup (Module: Microsoft. PowerShell. LocalAccounts) command. This command will list down all the groups on the particular system.

How do I get group details in PowerShell? ›

Use the Get-Group cmdlet to view existing group objects in your organization. This cmdlet returns security groups, mail-enabled security groups, distribution groups, and role groups. For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

How do I manage a group in Microsoft 365 admin center? ›

In the admin center, expand Groups, and then click Groups. Click the name of the group you want to manage to open the settings pane. In the admin center groups list, select the name of the group you want to change, and then on the Settings tab, select Allow external senders to email this group. Select Save.

How do I access Office 365 Groups? ›

You'll find your Microsoft 365 Groups in the navigation pane on the left in Outlook desktop or on the Web. With the new Microsoft 365 Groups hover card, you have quick access to shared group resources. Just hover over a group name in Outlook on the web or SharePoint.

How do I get user group membership in PowerShell? ›

Use Get-ADGroupMember cmdlet to List Members of an Active Directory Group. The PowerShell Get-ADGroupMember cmdlet is used to list the members of an Active Directory group. You can just type the cmdlet in a PowerShell window and you'll be prompted to enter the name of the group you want to use.

How do I create a group in PowerShell? ›

Navigate to Management > Group Management > Create Single Group. Enter the attribute values for the group. You can even import this list from a CSV file. Click Create.

How do I add multiple users to a group in Office 365 PowerShell? ›

Use the Add-UnifiedGroupLinks cmdlet to add members, owners and subscribers to Microsoft 365 Groups in your cloud-based organization. To remove members, owners, and subscribers, use the Remove-UnifiedGroupLinks cmdlet. To modify other properties of Microsoft 365 Groups, use the Set-UnifiedGroup cmdlet.

How do I see all groups in Microsoft 365? ›

You'll find your Microsoft 365 Groups in the navigation pane on the left in Outlook desktop or on the Web. With the new Microsoft 365 Groups hover card, you have quick access to shared group resources. Just hover over a group name in Outlook on the web or SharePoint.

How do I export a group list in Office 365? ›

In Office 365 Admin Center, go to the Exchange option. In the Recipients category, go to Groups and select Distribution list. In the Distribution list, choose the list you want to export externally. When you click on the Export option, it shows two options – Exports groups in this list or Export all groups.

How do I get a list of ad groups in PowerShell? ›

The PowerShell Get-ADGroupMember cmdlet is used to list the members of an Active Directory group. You can just type the cmdlet in a PowerShell window and you'll be prompted to enter the name of the group you want to use.

What PowerShell command will list domain groups? ›

The PowerShell Get-ADGroup cmdlet is used to search Active Directory for single or multiple groups. The Get-ADGroup filter parameter allows you to get a list of specific groups such as all global, universal, or domain local groups.

How do I edit groups in o365? ›

In the admin center, expand Groups, and then click Groups. Select the group that you want to edit, and then click Edit name and description. Update the name and description, and then select Save.

Videos

1. Manage Microsoft 365 accounts with PowerShell | IT Support skills
(Jobskillshare Community)
2. Microsoft 365 Groups
(Andy Malone MVP)
3. Run PowerShell with Microsoft 365 on your Windows PC
(Szymon Bochniak - Microsoft 365 atWork)
4. POWERSHELL FOR MICROSOFT 365
(Fitit)
5. Best practices and what's new for managing Office 365 groups
(Microsoft Tech Community)
6. MS-100 EP 13: Manage Groups in Microsoft 365
(A Guide To Cloud)
Top Articles
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated: 06/19/2023

Views: 5526

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.