Get the list permissions using SharePoint 2010 web service in powershell

Navigate to the SharePoint list, in the ribbon interface click on List tab. In the Settings group, click on List Settings. In the Permissions and Management section, click on Pemissions for this list. You could be able to view all the permissions for the list.

In this you will see how to get list permissions using SharePoint 2010 web service in powershell.

Steps Involved:

  1. Open SharePoint 2010 Management Shell by going to Start | All Programs | SharePoint | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell (Run as Administrator).
  2. Run the following script.

Powershell Script:

 
 
## Get the list permissions using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT2/_vti_bin/Permissions.asmx?wsdl"
## $listName is a string which contains the list name for which you need to get the permissions
[
String]$listName="DL1"
## $type is a string which contains the object type - List
[
String]$type="List"

## Web Service Reference - http://Site/_vti_bin/Permissions.asmx
$permissionWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
[
System.Xml.XmlNode]$xmlNode=$permissionWebServiceReference.GetPermissionCollection($listName,$type)

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


Output: GetListPermissions.xml

output.jpg