external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Sets list item permissions
Set-PnPListItemPermission -Identity <ListItemPipeBind>
-List <ListPipeBind>
[-InheritPermissions [<SwitchParameter>]]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Set-PnPListItemPermission -Group <GroupPipeBind>
-Identity <ListItemPipeBind>
-List <ListPipeBind>
[-AddRole <String>]
[-RemoveRole <String>]
[-ClearExisting [<SwitchParameter>]]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Set-PnPListItemPermission -User <String>
-Identity <ListItemPipeBind>
-List <ListPipeBind>
[-AddRole <String>]
[-RemoveRole <String>]
[-ClearExisting [<SwitchParameter>]]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User '[email protected]' -AddRole 'Contribute'
Adds the 'Contribute' permission to the user '[email protected]' for listitem with id 1 in the list 'Documents'
PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User '[email protected]' -RemoveRole 'Contribute'
Removes the 'Contribute' permission to the user '[email protected]' for listitem with id 1 in the list 'Documents'
PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User '[email protected]' -AddRole 'Contribute' -ClearExisting
Adds the 'Contribute' permission to the user '[email protected]' for listitem with id 1 in the list 'Documents' and removes all other permissions
PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -InheritPermissions
Resets permissions for listitem with id 1 to inherit permissions from the list 'Documents'
The role that must be assigned to the group or user
Type: String
Parameter Sets: User
Required: False
Position: Named
Accept pipeline input: False
Clear all existing permissions
Type: SwitchParameter
Parameter Sets: User
Required: False
Position: Named
Accept pipeline input: False
Type: GroupPipeBind
Parameter Sets: Group
Required: True
Position: Named
Accept pipeline input: False
The ID of the listitem, or actual ListItem object
Type: ListItemPipeBind
Parameter Sets: (All)
Required: True
Position: Named
Accept pipeline input: True
Inherit permissions from the list, removing unique permissions
Type: SwitchParameter
Parameter Sets: Inherit
Required: False
Position: Named
Accept pipeline input: False
The ID, Title or Url of the list.
Type: ListPipeBind
Parameter Sets: (All)
Required: True
Position: 0
Accept pipeline input: True
The role that must be removed from the group or user
Type: String
Parameter Sets: User
Required: False
Position: Named
Accept pipeline input: False
Type: String
Parameter Sets: User
Required: True
Position: Named
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