Add-PnPAzureADGroupOwner
SYNOPSIS
Required Permissions
- Microsoft Graph API: All of Group.ReadWrite.All, User.ReadWrite.All
Adds users to the owners of an Azure Active Directory group. This can be a security or Microsoft 365 group. Distribution lists are not currently supported by Graph API.
SYNTAX
Add-PnPAzureADGroupOwner -Identity <AzureADGroupPipeBind> -Users <String[]> [-RemoveExisting] [-Connection <PnPConnection>]
DESCRIPTION
Allows to add users to owners of an Azure Active Directory Group. This can be a security, distribution or Microsoft 365 group. By specifying -RemoveExisting
option it is possible to first clear the group of all existing members.
EXAMPLES
EXAMPLE 1
Add-PnPAzureADGroupOwner -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com"
Adds the provided two users as additional owners to the Azure Active Directory group named "Project Team".
EXAMPLE 2
Add-PnPAzureADGroupOwner -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com" -RemoveExisting
Sets the provided two users as the only owners of the Azure Active Directory group named "Project Team" by removing any current existing members first.
EXAMPLE 3
Add-PnPAzureADGroupOwner -Identity "Project Team" -Users "125eaa87-7b54-41fd-b30f-2adfa68c4afe"
Sets the provided security group as owner of the Azure Active Directory group name "Project Team".
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 Azure Active Directory group to add owners to.
Type: AzureADGroupPipeBind
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-RemoveExisting
If provided, all existing members will be removed and only those provided through Users will become members.
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 Azure Active Directory group as a member.
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