Set-PnPListPermission
SYNOPSIS
Allows permissions on a SharePoint list to be changed.
SYNTAX
Group
Set-PnPListPermission -Identity <ListPipeBind> -Group <GroupPipeBind> [-AddRole <String>]
[-RemoveRole <String>] [-Connection <PnPConnection>]
User
Set-PnPListPermission -Identity <ListPipeBind> -User <String> [-AddRole <String>] [-RemoveRole <String>]
[-Connection <PnPConnection>]
DESCRIPTION
Allows changing permissions on a SharePoint list. In case you would like to break the permission inheritance on a list from its parent, you can use Set-PnPList -BreakRoleInheritance. Use Get-PnPRoleDefinition to retrieve all available roles you can add or remove using this cmdlet.
EXAMPLES
EXAMPLE 1
Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -AddRole 'Contribute'
Adds the 'Contribute' permission to the user 'user@contoso.com' for the list 'Documents'.
EXAMPLE 2
Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -RemoveRole 'Contribute'
Removes the 'Contribute' permission from the user 'user@contoso.com' for the list 'Documents'.
PARAMETERS
-Identity
The Id, title or an instance of the list.
Type: ListPipeBind
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AddRole
The name of the role that must be assigned to the group or user. The name of the role is localized and depends on the language in which the site has been created, so i.e. for an English site you would use Full Control
, but for a Dutch site you would use Volledig beheer
.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RemoveRole
The name of the role that must be removed from the group or user. The name of the role is localized and depends on the language in which the site has been created, so i.e. for an English site you would use Full Control
, but for a Dutch site you would use Volledig beheer
.
Type: String
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: Group
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-User
A valid login name of a user (e.g. john@doe.com).
Type: String
Parameter Sets: User
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-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