Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 18th, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public static UserProfile EnsureUserProfile(SPSite elevatedSite, string userLoginName)
  2.         {
  3.             var context = SPServiceContext.GetContext(elevatedSite);
  4.             var profileManager = new UserProfileManager(context);
  5.  
  6.             var userProfile = SearchByLoginName(elevatedSite, userLoginName);
  7.  
  8.             if (!profileManager.UserExists(userLoginName))
  9.             {
  10.                 userProfile = profileManager.CreateUserProfile(userLoginName);
  11.             }
  12.  
  13.             return userProfile;
  14.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top