New-PnPMicrosoft365Group

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/New-PnPMicrosoft365Group.md to change this file.

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.Create, Group.ReadWrite.All

Creates a new Microsoft 365 Group

Syntax

New-PnPMicrosoft365Group
   -DisplayName <String>
   -Description <String>
   -MailNickname <String>
   [-Owners <String[]>]
   [-Members <String[]>]
   [-IsPrivate]
   [-LogoPath <String>]
   [-CreateTeam]
   [-HideFromAddressLists <Boolean>]
   [-HideFromOutlookClients <Boolean>]
   [-Force] 
   [<CommonParameters>]

Examples

EXAMPLE 1

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname

Creates a public Microsoft 365 Group with all the required properties

EXAMPLE 2

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -Owners "owner1@domain.com" -Members "member1@domain.com"

Creates a public Microsoft 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

EXAMPLE 3

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -IsPrivate

Creates a private Microsoft 365 Group with all the required properties

EXAMPLE 4

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers -IsPrivate

Creates a private Microsoft 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

Parameters

-CreateTeam

Creates a Microsoft Teams team associated with created group

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

The Description of the Microsoft 365 Group

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

The Display Name of the Microsoft 365 Group

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Specifying the Force parameter will skip the confirmation question.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HideFromAddressLists

Controls whether the group is hidden or shown in the Global Address List (GAL).

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HideFromOutlookClients

Controls whether the group shows in the Outlook left-hand navigation.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsPrivate

Makes the group private when selected

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LogoPath

The path to the logo file of to set. Supported formats are .png, .gif and .jpg

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MailNickname

The Mail Nickname of the Microsoft 365 Group. Cannot contain spaces.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Members

The array UserPrincipalName values of the group's members

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Owners

The array UserPrincipalName values of the group's owners

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False