lundi 9 mars 2015

How do I find all of the users in specific groups using SPServices on SharePoint 2010?



My intent is to list out specific user groups (six of them) and then list out the users that are a part of those six groups. I have tried using the following code, but have not been successful:



var members = [];
$().SPServices({
operation: 'GetUserCollectionFromGroup',
async: false,
cache: false,
webURL: 'https:website.goes.here',
groupName: 'Members',
completefunc: function(xData, Status){

$(xData.responseXML).find('[nodeName="User"]').each(function () {
members.push($(this).attr('Name'));

});
}
});


Is there anything I am missing or do I have something wrong with the code above? Please let me know if anyone needs more information to help me out.


Thanks!








0 commentaires:

Enregistrer un commentaire