Set-WssMsoSharePointPermission

Set-WssMsoSharePointPermission

Sets permission settings for a securable object.

Syntax

Parameter Set: ByLibrary
Set-WssMsoSharePointPermission [-Library] <SharePointLibrary> [-User] <SharePointUser> [-Permission] <WssMsoSharePointPermissionType> {Edit | FullControl | NoAccess | Read} [ <CommonParameters>]

Parameter Set: BySite
Set-WssMsoSharePointPermission [-Site] <SharePointSite> [-User] <SharePointUser> [-Permission] <WssMsoSharePointPermissionType> {Edit | FullControl | NoAccess | Read} [ <CommonParameters>]

Detailed Description

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

Parameters

-Library<SharePointLibrary>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Permission<WssMsoSharePointPermissionType>

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

     -- NoAccess
     -- Read
     -- Edit
     -- FullControl

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Site<SharePointSite>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-User<SharePointUser>

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

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • 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

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Set SharePoint permissions

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.

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

Get-WssMsoSharePointPermission

Remove-WssMsoSharePointPermission