How to get SharePoint user details from a particular group using SPServices

Is that possible get the members username of a particular SharePoint User group with the help of SPServices. Please help.

Answers


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.


Need Your Help

Controlling the movement of text on a parallax website?

javascript jquery html css parallax

I am working on a parallax website. The parallax relies on everything being a background image - the images that will move at different speeds.

Problems with Android Google Maps API v2 (

java android eclipse google-maps google-maps-api-2

I've been trying to create a Google Maps API v2 app in Eclipse and I keep running into a series of errors that I'm not sure how to solve.