#Add a sharepoint group using power shell
#Create a sharepoint custom permission using Power shell
$web = get-SPWeb "http://sitecollectionName"
$member = $web.AllUsers["domain\username"]
$CustomPermission ="Permission Name"
$CustomRoleRoledef = New-Object "Microsoft.SharePoint.SPRoleDefinition"
$CustomRoleRoledef.Name = "$CustomPermission"
$CustomRoleRoledef.Description = "Custom permission level for Site Owners"
# Create custom group
$CustomGroup ="My Custom Group"
$web.SiteGroups.Add("$CustomGroup", $member, $null,"Custom Group ")
#Assign Permission to the Group
$customPermission = $web.RoleDefinitions["$CustomRoleRoledef "]
# If you don't want to use custom permission, you can directly give existing permission name i.e "Full Control/Contributor/Design/Visitor"
#$existingPermission = $web.RoleDefinitions["Design"]
$customPermissionAssignment = New-Object "Microsoft.SharePoint.SPRoleAssignment" -ArgumentList $web.SiteGroups["$CustomGroup"]
#Remove a sharepoint group using power shell
#Remove Groups if already exist
$GroupName ="Custom Group"
$objSiteGroup = $web.SiteGroups["$GroupName"]
Note: you can save above script in .ps1 extension file and execute in power shell
To query SharePoint List or Document Library in specific Folder “ FolderServerRelativeUrl ” as part of the CAML Query Code Snippet ...
Recently, I stumbled upon a situation where I had Calendar list and I had provided custom save and cancel button. In List setting I had kep...
In order to call a web service in sandbox environment following steps should be followed. Note: Assuming you already have c...