How to pull user profile datas from my site


  • hi, 

    i want to pull personal datas (name , interest ,phone number etc .) from my site , how can i do it?

    thank you..

    Friday, March 11, 2011 1:04 PM


  • Add a refference to Microsoft.Office.Server.UserProfiles in the GAC.

    using Microsoft.Office.Server.UserProfiles ;

    SPServiceContext = SPServiceContext.GetContext(SPContext.Current.Site);

    UserProfileManager upm = new UserProfileManager(serviceContext);

    string sAccount = "domain\alias";

    if (!upm.UserExists(sAccount))




    UserProfile = upm.GetUserProfile(sAccount);

    //Do what you want with the profile here.

    *note, on a claims site, the account names will be encoded claims which might look like,

    i:w#|domain\alias (rough guess on spelling).

    My Blog: Website: Under Construction
    • Marked as answer by Eftal Cingöz Saturday, March 12, 2011 11:00 AM
    Friday, March 11, 2011 2:34 PM