Set-WssMsoSharePointPermission

Sets permission settings for a sp_online_2 securable object.

Syntax

Set-WssMsoSharePointPermission
   [-Library] <SharePointLibrary>
   [-User] <SharePointUser>
   [-Permission] <WssMsoSharePointPermissionType>
   [<CommonParameters>]
Set-WssMsoSharePointPermission
   [-Site] <SharePointSite>
   [-User] <SharePointUser>
   [-Permission] <WssMsoSharePointPermissionType>
   [<CommonParameters>]

Description

The Set-WssMsoSharePointPermission cmdlet sets permission settings for a sp_online_1 securable object, such as a library or a site. An office_365_1 site stores the sp_online_2library.

Examples

Example 1: Set SharePoint permissions

PS C:\> $Library= Get-WssMSOSharePointLibrary | Select-Object -First 1
PS C:\> $Principal= Get-WssMSOSharePointPrincipal | Select-Object -First 1
PS C:\> Set-WssMSOSharePointObjectPermission -Object $Library -Principal $Principal -Permission FullControl

The first command uses the Get-WssMsoSharePointLibrary cmdlet to get a library, and stores the result in the $Library variable.

The second command uses the Get-WssMsoSharePointPrincipal cmdlet to get a SharePoint principal, and stores the result in the $Principal variable.

The last command sets the SharePoint permissions for the library named $Library and the principal named $Principal.

Parameters

-Library

Specifies a sp_2013_1 library. The cmdlet sets permissions for the library that you specify.

Type:SharePointLibrary
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Permission

Specifies the permission for a sp_2013_2 principal to modify. The acceptable values for this parameter are:

 -- NoAccess

 -- Read

 -- Edit

 -- FullControl
Type:WssMsoSharePointPermissionType
Accepted values:NoAccess, Read, Edit, FullControl
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Site

Specifies a sp_2013_2 site. The cmdlet sets permissions for the site that you specify.

Type:SharePointSite
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-User

Specifies a name for a user account. The cmdlet sets permissions for the sp_2013_2 name that you specify.

Type:SharePointUser
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

Microsoft.WindowsServerSolutions.O365Integration.SharePointLibrary,Microsoft.WindowsServerSolutions.O365Integration.SharePointSite

Library -- Type: Microsoft.WindowsServerSolutions.O365Integration.SharePointLibrary -- Description: SharePoint library

Site -- Type: Microsoft.WindowsServerSolutions.O365Integration.SharePointSite -- Description: SharePoint site