EnumJobs whit AllUsers give E_ACCESSDENIED error

Nov 24, 2011 at 2:09 PM
Edited Nov 24, 2011 at 2:10 PM


 I try to enumerate all the jobs for all users. This work fine as long as there is no jobs created by a service. This service is running  as Local System account.

Here is the error and stack trace

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

at SharpBits.Base.IBackgroundCopyJob.SetNotifyInterface(Object Val)  

at SharpBits.Base.BitsJob.set_NotificationInterface(IBackgroundCopyCallback value) in harpBits.Base\BitsJob.cs:line 610

at SharpBits.Base.BitsJob..ctor(BitsManager manager, IBackgroundCopyJob job) in harpBits.Base\BitsJob.cs:line 42

at SharpBits.Base.BitsJobs.Update() in e:\2K7\src\ext\SharpBits.Base\BitsJobs.cs:line 65

at SharpBits.Base.BitsJobs.Update(IEnumBackgroundCopyJobs jobList) in SharpBits.Base\BitsJobs.cs:line 31

at SharpBits.Base.BitsManager.EnumJobs(JobOwner jobOwner) in SharpBits.Base\BitsManager.cs:line 100

I am testing this on a Windows 7 64 bit No UAC. I have tried the sample located here http://www.codeproject.com/KB/IP/sharpBITS.aspx?msg=2792345 by changing the enumeration to AllUsers with the same result.

If I list the jobs using BitsAdmin there is no error and all jobs are listed.

Does someone have an idea?

Thank you


Aug 21, 2012 at 6:25 PM

Same error here... :/

Aug 24, 2012 at 2:39 AM

You don't have the admin token. Even though you have UAC turned off you still have to request the token.

Feb 6, 2013 at 1:49 PM
Looks like issue in BITS 4.0 when trying to pass allusers for enum for this job. I think Microsoft changed the security protocol from reading their documentation. A virtual login doesn't give you the access you need to view another users BITS jobs from my basic understanding.