Search Results for

    Show / Hide Table of Contents

    Get-PnPGroupMember

    SYNOPSIS

    Retrieves all members of a SharePoint group

    SYNTAX

    Get-PnPGroupMember -Group <GroupPipeBind> [-User String]
    

    DESCRIPTION

    This command will return all the users (or a specific user) that are members of the provided SharePoint group

    EXAMPLES

    EXAMPLE 1

    Get-PnPGroupMember -Group "Marketing Site Members"
    

    Returns all the users that are a member of the group "Marketing Site Members" in the current site collection

    EXAMPLE 2

    Get-PnPGroupMember -Group "Marketing Site Members" -User "manager@domain.com"
    

    Will return a user if the user "manager@domain.com" is a member of the specified SharePoint group

    EXAMPLE 3

    Get-PnPGroup | Get-PnPGroupMember
    

    Returns all the users that are a member of any of the groups in the current site collection

    EXAMPLE 4

    Get-PnPGroup | ? Title -Like 'Marketing*' | Get-PnPGroupMember
    

    Returns all the users that are a member of any of the groups of which their name starts with the word 'Marketing' in the current site collection

    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
    

    -Group

    A group object, an ID or a name of a group

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

    RELATED LINKS

    Microsoft 365 Patterns and Practices

    Back to top Generated by DocFX spacer