Grant Permission in SharePoint

You can grant permissions to a user or group in SharePoint using Windows PowerShell. Simply add the user or group to the role assignment collection:

PS > $spWeb = Get-SPWeb http://SP01.powershell.nu
PS > $spPrincipal = [Microsoft.SharePoint.SPPrincipal]$spWeb.SiteGroups[$rGroup]
PS > $spWeb.RoleAssignments.Add($spPrincipal)
PS > $spWeb.Dispose()

Twitter This Tip! ReTweet this Tip!


Posted Jul 02 2012, 06:00 AM by sos
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.