The User Profile Services is able to do that, I show you how step by step:
- Go to Sharepoint Central Administrator and go to Manage service applications and click on User Profile Services
- Then click on Manage User Properties
- Create New Property and insert the information that you need
- Now come back and click on Manage User Profiles
- Find the user where you want insert the new property and edit it
- Add the value that you need
//Get Current Site var site = SPContext.Current.Site; //Define Server Context var cx = SPServiceContext.GetContext(site); //Create an instance of the User Profile Manager var profileManager = new UserProfileManager(cx); var user = profileManager.GetUserProfile(SPContext.Current.Web.CurrentUser.Name); string str = user["CustomerClassification"].Value.ToString();
bye
No comments:
Post a Comment