Welcome to SharePoint 2010 once again after a long time. Normally we developers will get some quick requirement to get all the role definitions of the site quickly.
If it’s a small site you can go into the Site Permissions and on the top you have Permission Levels where you can get the following levels as per the screen shot.
But if it is a big site and you need to provide some kind of a document to the client then you can do it here using PowerShell.
A quick one that will involve a few seconds only.
Click on Start then right-click on SharePoint 2010 Management Shell and Run as Administrator.
PowerShell offers a powerful method of working with URIs by leveraging the System.Uri .NET class that offers many properties and methods that provide a way to easily manipulate and compare URIs. This class can be utilized using the [System.Uri] notation in PowerShell. You can get the full list of properties and methods by using the $uri command.
The following is the web service command you can test using your site.
Web Service Command: http://Your Site Name/_vti_bin/UserGroup.asmx
Here is the PowerShell you need to run.
- ## Add in the Url
- $uri=“Your Site/_vti_bin/UserGroup.asmx?wsdl”
- $usergroupWebServiceInput = New-WebServiceProxy -Uri $uri -UseDefaultCredential
- ## Here generate a xml file in the location containing the properties
- $output = New-Object -TypeName System.IO.StreamWriter -ArgumentList “D:\Manpreet\Webserviceresult.xml”, $false
- $output.WriteLine(“<?xml version=””1.0″” encoding=””utf-8″” ?>“)
Finally after running the script you will find the XML in your location and the output will be shown as per the screen shot.