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

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

2 Answers 2

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

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

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.