Skip to content

Latest commit

 

History

History
123 lines (89 loc) · 3.9 KB

Get-PnPUser.md

File metadata and controls

123 lines (89 loc) · 3.9 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Get-PnPUser

SYNOPSIS

Returns site users of current web

SYNTAX

Get-PnPUser [-Identity <UserPipeBind>]
            [-WithRightsAssigned [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <SPOnlineConnection>]

DESCRIPTION

This command will return all the users that exist in the current site collection its User Information List

EXAMPLES

------------------EXAMPLE 1------------------

PS:> Get-PnPUser

Returns all users from the User Information List of the current site collection regardless if they currently have rights to access the current site

------------------EXAMPLE 2------------------

PS:> Get-PnPUser -Identity 23

Returns the user with Id 23 from the User Information List of the current site collection

------------------EXAMPLE 3------------------

PS:> Get-PnPUser -Identity i:0#.f|membership|[email protected]

Returns the user with LoginName i:0#.f|membership|[email protected] from the User Information List of the current site collection

------------------EXAMPLE 4------------------

PS:> Get-PnPUser | ? Email -eq "[email protected]"

Returns the user with e-mail address [email protected] from the User Information List of the current site collection

------------------EXAMPLE 5------------------

PS:> Get-PnPUser -WithRightsAssigned

Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to the current site

------------------EXAMPLE 6------------------

PS:> Get-PnPUser -WithRightsAssigned -Web subsite1

Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to subsite 'subsite1'

PARAMETERS

-Identity

User ID or login name

Type: UserPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-WithRightsAssigned

If provided, only users that currently have any kinds of access rights assigned to the current site collection will be returned. Otherwise all users, even those who previously had rights assigned, but not anymore at the moment, will be returned as the information is pulled from the User Information List. Only works if you don't provide an -Identity.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

RELATED LINKS

SharePoint Developer Patterns and Practices