Skip to content

Latest commit

 

History

History
190 lines (147 loc) · 4.28 KB

Set-PnPWebPermission.md

File metadata and controls

190 lines (147 loc) · 4.28 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Set-PnPWebPermission

SYNOPSIS

Set permissions

SYNTAX

Group

Set-PnPWebPermission -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

User

Set-PnPWebPermission -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

GroupByWebIdentity

Set-PnPWebPermission -Identity <WebPipeBind>
                     -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

UserByWebIdentity

Set-PnPWebPermission -Identity <WebPipeBind>
                     -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

GroupByWebUrl

Set-PnPWebPermission -Url <String>
                     -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

UserByWebUrl

Set-PnPWebPermission -Url <String>
                     -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <SPOnlineConnection>]

DESCRIPTION

Sets web permissions

EXAMPLES

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

PS:> Set-PnPWebPermission -Url projectA -User '[email protected]' -AddRole 'Contribute'

Adds the 'Contribute' permission to the user '[email protected]' for a web, specified by its site relative url

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

PS:> Set-PnPWebPermission -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0 -User '[email protected]' -RemoveRole 'Contribute'

Removes the 'Contribute' permission to the user '[email protected]' for a web, specified by its ID

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group

Required: True
Position: Named
Accept pipeline input: False

-Identity

Identity/Id/Web object

Type: WebPipeBind
Parameter Sets: GroupByWebIdentity

Required: True
Position: Named
Accept pipeline input: True

-RemoveRole

The role that must be removed from the group or user

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

The site relative url of the web, e.g. 'Subweb1'

Type: String
Parameter Sets: GroupByWebUrl

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