SharePoint 2010 - Retrieve the Permission Mask Values for a Site using Powershell

This article stems from another article explaining how to Automate Site & Group Creation with Nintex Workflow 2010

Use Powershell to retrieve detailed data about the permission levels on a particular site

I was looking for a way to automate Site & Group creation using nintex workflows.  In order to create groups, you need to call a SharePoint Web Service.  That Web Service requires an input value called 'permissionMask (int)'.

This powershell script will allow you to find the correct permission Mask related to your particular environment & permission levels.

Jump onto your WFE, open up SharePoint Powershell as admin and paste in the following code (with the site you wish to retrieve data for:

## Get site permissions using SharePoint 2010 web service in powershell
## $siteName is a string which contains the site name for which you need to get the permissions
[String]$siteName="site name"
## $type is a string which contains the object type - List

## Web Service Reference - http://rootsite/subsite/_vti_bin/Permissions.asmx
$permissionWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential 

## Creates an GetSitePermissions.xml file in the D:\ which contains the permissions for the site
$output = New-Object -TypeName System.IO.StreamWriter -ArgumentList "C:\temp\GetSitePermissions.xml", $false
$output.WriteLine("<?xml version=""1.0"" encoding=""utf-8"" ?>")

Once the script has run, navigate to C:\Temp and grab the Mask value against the group that has the permissions you want to mimic.

Credit where it's due
Vijai for providing the code:


Popular posts from this blog

Export Group Membership From Active Directory Using Power Query

HP Laserjet 1022 Printer - Can't Print on Windows 10

Power Query / BI - Data Refresh Error: The column 'Activities' of the table wasn't found