Question

I need to call a method from publishing.administration-Namespace as a farm admin. To be specific: ContentDeploymentJob.GetAllJobs();

When I try to run that code I get the exception that the code can only be run by farm administrators.

SPSecurity.RunWithElevatedPrivileges does not help. Also running under the System Accounts SPUserToken Like 'SPSite("myWebsite.com",SPUserToken.SystemAccount)' is of no help, because I am not in a SPSite-Context

Which ways are there to achieve that?

Was it helpful?

Solution

Meanwhile I found out that can not be done in a normal SiteCollection. You have to create a timerjob to read and start Content-Deployments and then communicate with you Site Collection

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top