Pulling information from the User Information List.

May 17, 2011 at 12:06 AM

I’m still a little new to jquery and SPServices but am finding both very useful.

Im creating a custom JavaScript solution for our SharePoint intranet,

I want to create an JavaScript array containing all users, the url to their photo, an extension number and a few other custom user fields.

It seems like SPService should be capable of this, but where do I start?

I have a fairly good grasp of JavaScript.

May 17, 2011 at 2:27 AM


Do you really want ALL users? Because that's actually sort of difficult. If it's a subset of users based upon some group membership or site role, then either the Users and Groups and/or UserProfileService Web Services may help. Can you explain more about your actual requirements?


May 17, 2011 at 2:48 AM

Thanks for getting back to me, I am in the process of building an office maps.

I have created a map of the office, its a Google maps style map, I can dynamically build objects on the map, people, pcs, printers… . and navigate around it.

I have a list all seat location with a SeatID and x,y.

Then I wanted to add an extra field in the users information list that references the SeatID.

Then I want to be able to display information about staff as a tool tip(i can do but i just need the information).

I guess I could have a people field in the seat list, but I still want to be able to reference say the url of the profile picture, extention number and such.

We have about 120 staff, so the list isnt going to be massive.

I am open for suggestions/work arounds. 

May 17, 2011 at 2:51 AM

I could use a subset of users upon a group.

May 17, 2011 at 2:57 AM

Take a look at combining the results of a call to GetUserCollectionFromGroup with calls to GetUserProfileByName to get the individual profile data. I'm almost certain that will get you what you need.


May 17, 2011 at 4:01 AM

Thanks for your help Marc, I think im almost there, using your example of GetUserProfileByName, seems to do the job, but how about accessing other fields, say "Picture", or custom fields like extention number?

 operation: "GetUserInfo",
 userLoginName: "domain\\user",
 completefunc: function (xData, Status) {
  $("#WSOutput").html("").append("<b>This is the output from the GetUserInfo operation:</b>");
  $(xData.responseXML).find("User").each(function() {
   $("#WSOutput").append("<li>ID: " + $(this).attr("ID") + "</li>");
   $("#WSOutput").append("<li>Sid: " + $(this).attr("Sid") + "</li>");
   $("#WSOutput").append("<li>Name: " + $(this).attr("Name") + "</li>");
   $("#WSOutput").append("<li>LoginName: " + $(this).attr("LoginName") + "</li>");
   $("#WSOutput").append("<li>Email: " + $(this).attr("Email") + "</li>");
   $("#WSOutput").append("<li>Notes: " + $(this).attr("Notes") + "</li>");
   $("#WSOutput").append("<li>Extension: " + $(this).attr("Notes") + "</li>");
   $("#WSOutput").append("<li>IsSiteAdmin: " + $(this).attr("IsSiteAdmin") + "</li>");
   $("#WSOutput").append("<li>IsDomainGroup: " + $(this).attr("IsDomainGroup") + "</li>");

Can i run a CAML Query?  Using U2U CALM QUERY Builder, i seem to be able to list the information i need?

May 17, 2011 at 4:04 AM

In the code you've posted, you're calling GetUserInfo. Calling GetUserProfileByName will get you the information in the User Profile Store.


May 17, 2011 at 4:14 AM

Sorry, I probably should have included this in the first post be this is a SharePoint foundation 2010 install at this site, I think that UserProfileService is not avaliable ?

May 17, 2011 at 4:19 AM

Ah. Yeah, the method is different, then.

Any information will be in the User Information List. You can actually query that just like any other list with GetListItems or a DVWP. It's just hidden in the UI.



May 30, 2011 at 9:24 PM

I'm interested in this post. I want to be able to get all the users from my site (Sharepoint 2007). Because I want to output that on an excel workbook. It will be good if I can get First Name and Last Name but the full name will be enough. I can't see how to get all the names and I don't really understand this post here. Anyone can help?  Besides that I'm interested to get some information from a calendar to put in that same excel sheet. Thank you for any help. I want to do all that on a CEWP.



May 30, 2011 at 11:12 PM

This might be overly complex for what you want, I needed to get user information into a JavaScript variable so that i could display it as a tool tip.

Is it just a one off thing?

http://sharepointRoot/_layouts/people.aspx?MembershipGroupId=0 (works in SharePoint 2010, might have been slightly different under MOSS)



Then just export to excel.

The example given above by M should do the job:


If you would still like to do it the way I would be happy to help you,

You would used a calm query to pull information from the “User Information List”, you would use

It would look something like this if you wanted to show it using SPS service.

  operation: "GetListItems",
  webURL: "/",
  listName: "User Information List",
  CAMLQuery: camlQuery,
  CAMLViewFields: ViewFields,
   CAMLRowLimit: 0500,
     completefunc: function (xData, Status) { 

display the information code

camlQuery variable would be you calm query text
ViewFields would select what fields you wanted to view.