Add-PnPMicrosoft365GroupOwner
SYNOPSIS
Required Permissions
- Microsoft Graph API: All of Group.ReadWrite.All, User.ReadWrite.All
Adds users to a Microsoft 365 Group as Owners.
SYNTAX
Add-PnPMicrosoft365GroupOwner -Identity <Microsoft365GroupPipeBind> -Users <String[]> [-RemoveExisting] [-Connection <PnPConnection>]
DESCRIPTION
Allows to add multiple users to Microsoft 365 Group as owners.
EXAMPLES
EXAMPLE 1
Add-PnPMicrosoft365GroupOwner -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com"
Adds the provided two users as additional owners to the Microsoft 365 Group named "Project Team".
EXAMPLE 2
Add-PnPMicrosoft365GroupOwner -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com" -RemoveExisting
Sets the provided two users as the only owners of the Microsoft 365 Group named "Project Team" by removing any current existing members first.
PARAMETERS
-Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: PnPConnection
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Identity
The Identity of the Microsoft 365 Group to add owners to.
Type: Microsoft365GroupPipeBind
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-RemoveExisting
If provided, all existing owners will be removed and only those provided through Users parameter will become owners.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Users
The UPN(s) of the user(s) to add to the Microsoft 365 Group as an owner.
Type: String[]
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
RELATED LINKS
Microsoft 365 Patterns and Practices Microsoft Graph documentation