Saturday, December 10, 2011

Get User Details by ID in SharePoint 2010

Hello,

If you want to get the user details like Name, Email and other details of SharePoint user based on ID (Example: 12;domain\username), then the below code will be useful

SPContext.Current.Web.AllUsers.GetById(12).Email

4 comments:

  1. Hello, is it possible to call the "AllUser" method via the SOAP API? I can't find a method for retrieving an user by his ID.

    ReplyDelete
    Replies
    1. Hello, as far i know, we dont have a method to call AllUser method via SOAP API. However, you can write a custom webservice which uses AllUsers method (Server Object Model) and then you can use that service.

      Delete
  2. Thank you very much, that helped me a lot.

    ReplyDelete