Acquiring SharePoint PowerShell Document Library Security Level Users
I am using SharePoint Web Services Access to collect site-level security users. SharePoint recognizes Active Directory security groups as users (not groups). I put together these pseudo groups with a SOAP request (see below) using SharePoint web services via http://{site}/_vti_bin/Lists.asmx
:
$uri = $context
$soap = '<?xml version="1.0" encoding="utf-8"?>'
$soap+= '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
$soap+= '<soap:Body>'
$soap+= '<GetUserCollectionFromWeb xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/" />'
$soap+= '</soap:Body>'
$soap+= '</soap:Envelope>'
[xml]$WF = Invoke-RestMethod $uri -Credential $CRED -Method POST -ContentType "text/xml" -Body $soap
$Users = $WF.Envelope.Body.GetUserCollectionFromWebResponse.GetUserCollectionFromWebResult.GetUserCollectionFromWeb.Users.User
The above request is successful at the site and sub site level. But it does not keep pace at the level of the library, lists and documents.
Is there a resource via Web Service Access that reflects GetUserCollectionFromWeb at the library, list, and document level?
I am starting to rip my hair out trying to access this data.
Thank.
source to share
You would use the Permissions web service available in /_vti_bin/Permissions.asmx
.
You can refer to the MSDN documentation on the permission service here .
The method GetPermissionCollection
will give you an xml snippet with members (by id) and permission masks.
You can use the People web service ( /_vti_bin/People.asmx
) to associate member IDs with actual people and groups.
source to share