SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used the folowing stmt to add permissions to group:


gives following error

Exception calling "Add" with "1" argument(s): "This operation is not allowed on an object that inherits permissions."

Regards, any suggestions/help would be higly appreciated

Ketan Gandhi.

share|improve this question

There needs to be a call to $web.BreakRoleInheritance(true) before adding any role assignments. The "true" means that it copies the existing permissions when it breaks inheritance, with false it starts with no permissions.

share|improve this answer

Try this function:

function Create-SPGroupInWeb
 param ($Url, $GroupName, $PermissionLevel, $Description)
 $web = Get-SPWeb -Identity $Url
 if ($web.SiteGroups[$GroupName] -ne $null)
  Write-Host "Group $GroupName already exists!" -foregroundcolor Red
  $web.SiteGroups.Add($GroupName, $web.Site.Owner, $web.Site.Owner, $Description)
  $group = $web.SiteGroups[$GroupName]
  $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
  $roleDefinition = $web.Site.RootWeb.RoleDefinitions[$PermissionLevel]
  Write-Host "Group $GroupName created successfully" -foregroundcolor Green


For more information, you can visit

share|improve this answer
I have already refered the same link and code...still giving me error. I am executing my code using Windows ISE – Ketan03 Aug 17 '12 at 9:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.