Skip to content

Latest commit

 

History

History
200 lines (151 loc) · 4.68 KB

Set-PnPListItemPermission.md

File metadata and controls

200 lines (151 loc) · 4.68 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Set-PnPListItemPermission

SYNOPSIS

Sets list item permissions

SYNTAX

Inherit

Set-PnPListItemPermission -Identity <ListItemPipeBind>
                          -List <ListPipeBind>
                          [-InheritPermissions [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <SPOnlineConnection>]

Group

Set-PnPListItemPermission -Group <GroupPipeBind>
                          -Identity <ListItemPipeBind>
                          -List <ListPipeBind>
                          [-AddRole <String>]
                          [-RemoveRole <String>]
                          [-ClearExisting [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <SPOnlineConnection>]

User

Set-PnPListItemPermission -User <String>
                          -Identity <ListItemPipeBind>
                          -List <ListPipeBind>
                          [-AddRole <String>]
                          [-RemoveRole <String>]
                          [-ClearExisting [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <SPOnlineConnection>]

EXAMPLES

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

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'

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

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'

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

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

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

PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -InheritPermissions

Resets permissions for listitem with id 1 to inherit permissions from the list 'Documents'

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String
Parameter Sets: User

Required: False
Position: Named
Accept pipeline input: False

-ClearExisting

Clear all existing permissions

Type: SwitchParameter
Parameter Sets: User

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group

Required: True
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-InheritPermissions

Inherit permissions from the list, removing unique permissions

Type: SwitchParameter
Parameter Sets: Inherit

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-RemoveRole

The role that must be removed from the group or user

Type: String
Parameter Sets: User

Required: False
Position: Named
Accept pipeline input: False

-User

Type: String
Parameter Sets: User

Required: True
Position: Named
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

RELATED LINKS

SharePoint Developer Patterns and Practices