SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an option to show users like the SPFieldUser?

I have a custom c# webpart and want show usernames. Every username i want to link to a userprofile.

I also want the online status of a user.

share|improve this question
Do you want to show their online status as in Presence? – Matthew McDermott Aug 18 '12 at 12:38

you can try to see if this works out for you?

or Get current logged user name for user "Account operates as System"

or use SharePoint Site User Directory

or you can try your own method:

create a database table and for each user that logs in then recored the ID, Username and time stamp and get the data from there using stored procedures.


Ok i get what you mean ;) , well inthat case you will need to call Active directory to get the list of users and populate a list, somthing like spGridview or a table. I would personaly recommend SPGridview. From there you can get all the users and user details.

For me I would create an SQL table that contains a uniqe ID, user name, email and timestamp. You can then connect the SPGridview via databinding and wrap in ajax update panel. You might need another colum in the table that has either online, offline.

So every time a user logs in it updates the table via stored procedure, find the user.... update time stamp and set status to online. When the webpart is loaded you would need to call the table and get the info from the user to display. So you can display the user name, the email, the time they logged in and weather they are online or not ;). You would also need to set the status to offline when the user leaves or is inactive. As this is all in an ajax update panel it should update without loading the whole page.

have a look at this its a waterd down version but on the right lines :)

share|improve this answer
The problem is not getting the users, but the problem is how to present the users. – Active_t Aug 17 '12 at 13:24
Iv added some more detailed parts above in the origional post! hope it helps you solve your problem :) – ali Sharepoint Aug 17 '12 at 13:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.