Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

My OWSTIMER.EXE process is running under network service.

I have a certain timer job that should perform the following actions:

  1. Add taxonomy terms to a certain term store
  2. Add items to a certain sharepoint list, located in a certain sharepoint site.

While this alone isn't rocket science, the timer job runs under the same principal as the OWSTimer.exe process, so in other words network service.

Obviously I don't want the network service account to have permissions to manage a taxonomy term store, neither SharePoint lists, so I had already setup an account to do this.

How can I run blocks of code in my timer job under this account I created which should have access to the term store and sharepoint lists?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Dare I ask why you have the timer service running under the Network service account? Seems to me you are tackling the problem the wrong way. Best practice would be to run the timer service under a (least privileged) service account.

share|improve this answer
    
I think this is the way to tackle the problem. Would have been nice if timer jobs could be configured to run under certain identities, rather than the one size fits all timer service running everything. But this will suffice for now. –  user879 Jan 12 '11 at 21:01
add comment

Make use of User Impersonation to have blocks of code run as another user.

Good example here: http://blackninjasoftware.com/2009/04/09/how-to-programmatically-impersonate-users-in-sharepoint/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.