external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Returns site users of current web
Get-PnPUser [-Identity <UserPipeBind>]
[-WithRightsAssigned [<SwitchParameter>]]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
This command will return all the users that exist in the current site collection its User Information List
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
PS:> Get-PnPUser -Identity 23
Returns the user with Id 23 from the User Information List of the current site collection
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
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
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
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'
User ID or login name
Type: UserPipeBind
Parameter Sets: (All)
Required: False
Position: 0
Accept pipeline input: True
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
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
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