Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `$web=Get-SPWeb "http://sitecollectionurl"`
- $newGroup=$web.SiteGroups.Add($groupName,$web.Site.Owner,$web.Site.Owner,$description)
- $group=$web.SiteGroups[$groupName]
- $roleAssignment=New-Object Microsoft.SharePoint.SPRoleAssignment($group)
- $roleDefinition=$web.RoleDefinitions[$permissionLevel]
- $roleAssignment.RoleDefinitionBindings.Add($roleDefinition)
- $web.RoleAssignments.Add($roleAssignment);
- $web.Update()
- $web.Dispose()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement