Is that possible get the members username of a particular SharePoint User group with the help of SPServices. Please help.
You can do something like this.Basically I am checking if user belongs to a particular group,get his/her details.
SPServices Code
$().SPServices({
operation: "GetUserCollectionFromSite",
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName=User]").each(function() {
if(Getrolesforuser($(this).attr("Name")) == "Your group from which you want users")
{
$('#nameSelect').append("<option value='" + $(this).attr("ID") + ";#" + $(this).attr("Name") + "'>" + $(this).attr("Name") + "</option>");
}
});
}
});
Then find the groups of input user
function Getrolesforuser(user)
{
loggedinUserGroup="";
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: user,
async: false,
completefunc: function(xData, Status)
{
$(xData.responseXML).find("Group").each(function()
{
if(loggedinUserGroup=="")
{
loggedinUserGroup = $(this).attr("Name");
}
else
{
loggedinUserGroup = loggedinUserGroup + "\n"+ $(this).attr("Name");
}
});
}
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.