Add Permission Levelsto a Group in SharePoint

You can add permission levels to a user or group in SharePoint 2010 using Windows PowerShell. First, store the permission level in a variable, next retrieve the user or group from the role assignments collection, and finally use the add() method to add a specific permission level. The example below demonstrates how to grant the members group full control on a Web site:

PS > $spWeb = Get-SPWeb http://SP01.powershell.nu
PS > $roleDefinition = 
>> $spWeb.RoleDefinitions | Where-Object { $_.Name -eq "Full Control" }
PS C:\> $spWeb.RoleAssignments | 
>> Where-Object { $_.Member -like "*Members" } | foreach {
>> $_.RoleDefinitionBindings.Add($roleDefinition)
>> $_.Update()
>> }

Twitter This Tip! ReTweet this Tip!


Posted Jul 04 2012, 06:00 AM by sos

Comments

Add Permission Levelsto a Group in SharePoint – SharePoint Tips … | Mastering Sharepoint wrote Add Permission Levelsto a Group in SharePoint – SharePoint Tips … | Mastering Sharepoint
on 07-04-2012 9:45 PM

Pingback from  Add Permission Levelsto a Group in SharePoint – SharePoint Tips … | Mastering Sharepoint

Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.