Forum Discussion
Kumar32490
Feb 15, 2021Copper Contributor
SharePoint 2013 Timer Job - Remove user from SharePoint group not working
I have written a SP2013 timer job, which should remove user from SharePoint group when triggered. Written below piece of code in CustomTimerJob.cs. It updates the list item status to Active/Expired s...
Sudharsan K
Feb 17, 2021Iron Contributor
Timer jobs are running as a separate service and if I am right, the service is running under the Farm account. So you can't use RunWithElevatedPrivilege in timer jobs. Also, try to get the site and web object from the web application and then pass the web object to the RemoveUser method instead of using the URL and then getting the web.
Try the above and let me know.
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...