UserProfileManager in Sharepoint Timer job

15/12/2015 04:38

Get service context from site, not from httpContext as usual

   

SPServiceContext serviceContext = SPServiceContext.GetContext(site);
UserProfileManager userProfileMgr = new UserProfileManager(serviceContext);