search
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
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
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?