GetUserCollectionFromGroup not working on my WSS sites.

Apr 8, 2013 at 3:58 PM
Edited Apr 8, 2013 at 9:50 PM
I am trying to write a function that returns all the members of a given group. My code seems to work just fine when I am looking at groups created in MOSS sites, but I can't seem to get it to work on my WSS sites. Anything I need to know? Can someone please point me in the right direction?
function GetGroupMembers(strWeb, strGrpName){

$("#myOutDiv").html("<table id='tblGroupMembers' class='ms-vb'><tr><th>ID</th><th>Name</th><th>UserID</th></tr></table>");
    
           $().SPServices({
        operation: "GetUserCollectionFromGroup",
        async: false,
        webURL: strWeb,
        groupName: strGrpName,
        debug: true,
        completefunc: function (xData, Status) {
            if (Status == "success"){                                                       $(xData.responseXML).SPFilterNode("User").each(function() {
                $("#tblGroupMembers tr:last").after("<tr><td>" + $(this).attr("ID") + "</td><td>" + $(this).attr("Name") + "</td><td>" + $(this).attr("LoginName") + "</td></tr>");                         });
        }
    }
  });
     return true;   
}
Apr 8, 2013 at 7:22 PM
You'll want to make sure the Group Settings allow for "Everyone" to view membership of the group. Make sure that is set and see if you get the results you expect.

Cheers,
Matthew
Apr 8, 2013 at 8:45 PM
I checked that and it is set to "Everyone" as suggested but still no juice. Are there any server side settings that will prevent this webservice call?

I tried stepping through the code, and on my WSS sites the completefunc Status returns "error", but I cant seem to find the error string. I have tried
$(this).find("[nodeName='faultcode']:first").text();
$(this).find("[nodeName='ErrorCode']:first").text();
$(this).find("[nodeName='faultstring']").text();
$(this).find("[nodeName='errorstring']").text();
all return nothing,
Apr 9, 2013 at 1:00 AM
If the status variable of the completefunc() returns error, then that means the call to the server failed. Status tracks the communications to the server. Meaning, it was not even processed by SharePoint so you will not see an error returned.
Using the client side tools like firebug or fiddler, check the call for errors.

_____
Paul

Sent from mobile device.