Is there any way to get all local contentdeployment jobs from within web application code?

I'm trying to list all jobs on an aspx page in the backend of a site collection, but everytime I execute this:


an AccessDenied Exception raises, saying that the executing user is not a farm admin. If I try it with ElevatedPriviliges or Impersonation as farm admin it doesnt work too.

  • Already found a solution for this?
    – Ole Albers
    Dec 6 '12 at 14:18

After a few months of not thinking about this issue I found an answer:

Execute the following PowerShell Script and it should work (tested on a standalone farm):

PS C:\Users\xxx> $contentService  = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
PS C:\Users\xxx> $contentService.RemoteAdministratorAccessDenied = $false
PS C:\Users\xxx> $contentService.Update()

Here my testing code (executed in a webpart):

    ContentDeploymentJobCollection jobs = ContentDeploymentJob.GetAllJobs();
    foreach (ContentDeploymentJob job in jobs)
 catch (Exception ex)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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