I am trying to use GetUserCollectionFromRole Method to get list of all users having certain permission level (for e.g. Contribute) in a particular site and I'm having some issues with it.
My Steps are as follows:
1. Using "Call Web Service" action
2. Web Service using is - "WebURL/_vti_bin/usergroup.asmx"
3. Passing my site collection credentials
4. As a web service input, there is only one field i.e. roleName (string) - value entered is "Contribute"
After passing these values I am testing my action using "Run Now" command and click Execute, I'm getting output as shown below:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetUserCollectionFromRoleResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<GetUserCollectionFromRoleResult>
<GetUserCollectionFromRole>
<Users />
</GetUserCollectionFromRole>
</GetUserCollectionFromRoleResult>
</GetUserCollectionFromRoleResponse>
</soap:Body>
</soap:Envelope>
As the result shows, my output is empty.
Instead of this if I follow above steps and select "GetUserCollectionFromGroup" method instead and pass web service input as "<site name> Members", my output is as shown below:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetUserCollectionFromGroupResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<GetUserCollectionFromGroupResult>
<GetUserCollectionFromGroup>
<Users>
<User ID="2465" Sid="S-1-5-21-2042961196-1878016268-396375212-314087" Name="<Name of a user>" LoginName="<user login>" Email="<Users Email Address>" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" />
</Users>
</GetUserCollectionFromGroup>
</GetUserCollectionFromGroupResult>
</GetUserCollectionFromGroupResponse>
</soap:Body>
</soap:Envelope>
I am not sure what am I doing wrong !!!!