Updating user data from external source

Vote:
 

Hi,

I am writing a scheduled job to update user data from an Active Directory. I am pulling the member list from Membership.GetAllUsers(), and successfully loading the profile data from AD. What I don't know how to do is saving this data back to EPiServer. When the code was only updating the current user, it used EPiServer.Community.CommunitySystem.CurrentContext.DefaultSecurity.CurrentUser .Clone() for writing the data and EPiServer.Community.CommunitySystem.CurrentContext.DefaultSecurity.UpdateUser(displayUserClone); for persisting the data. However, AFAIK CurrentContext is not available in a scheduled job - I tried Settings.DefaultSecurity.GetUserByUserName(user.UserName) and UserQuery, but I am unable to find the user. How can I update the user from a scheduled job?

#47456
Jan 28, 2011 15:54
Vote:
 

Hi Lasek

I'm guessing as this post is quite old now, you've probably already found a solution, but you could try

SecurityHandler.Instance.GetUser() and SecurityHandler.Instance.UpdateUser() 

Hope this helps

 
#54757
Nov 01, 2011 11:41
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.