Show / Hide Table of Contents

    Add-PnPGroupMember

    SYNOPSIS

    Adds a user to a SharePoint group

    SYNTAX

    Internal

    Add-PnPGroupMember -LoginName <String> -Group <GroupPipeBind> 
     [-Connection <PnPConnection>] [<CommonParameters>]
    

    External

    Add-PnPGroupMember -Group <GroupPipeBind> -EmailAddress <String> [-SendEmail] [-EmailBody <String>]
     [-Connection <PnPConnection>] [<CommonParameters>]
    

    DESCRIPTION

    Allows to add new user to SharePoint group. The SharePoint group may be specified either by id, name or related object.

    EXAMPLES

    EXAMPLE 1

    Add-PnPGroupMember -LoginName user@company.com -Group 'Marketing Site Members'
    

    Add the specified user to the SharePoint group "Marketing Site Members"

    EXAMPLE 2

    Add-PnPGroupMember -LoginName user@company.com -Group 5
    

    Add the specified user to the SharePoint group with Id 5

    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
    

    -EmailAddress

    The email address of the user

    Type: String
    Parameter Sets: External
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -EmailBody

    Type: String
    Parameter Sets: External
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -Group

    The SharePoint group id, SharePoint group name or SharePoint group object to add the user to

    Type: GroupPipeBind
    Parameter Sets: (All)
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: True (ByValue)
    Accept wildcard characters: False
    

    -LoginName

    The login name of the user

    Type: String
    Parameter Sets: Internal
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -SendEmail

    Type: SwitchParameter
    Parameter Sets: External
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    RELATED LINKS

    Microsoft 365 Patterns and Practices

    Back to top Generated by DocFX spacer