Impersonation

Jul 14, 2009 at 7:54 PM

Is it possible to use impersonation for jobs?  I know I can get a job that is downloading via http from IIS to work with the following code:

                Dim credz As New SharpBits.Base.BitsCredentials
                credz.AuthenticationScheme = SharpBits.Base.AuthenticationScheme.Ntlm

                credz.UserName = domain\someusername
                credz.Password = thepassword
                credz.AuthenticationTarget = SharpBits.Base.AuthenticationTarget.Server
                credz.AuthenticationScheme = SharpBits.Base.AuthenticationScheme.Ntlm

However is it possible to use impersonation?  I know the IBackgroundCopyJob2::SetCredentials method if passed a null username/password does impersonation but I don't see how to use that method with Sharpbits.  Any ideas?

Jul 16, 2009 at 3:02 PM

Don't provide any server credentials. It will use the credentials of the currently logged on user/job owner to connect to the server.

Jun 9, 2010 at 8:42 PM

How do you assign the credentials to the current job or bits Manager object?

Jan 9, 2011 at 3:29 PM

Impersonation is not possible. The user must be logged on to the machine for a BITS job to run. The only exception to this is if the job is submitted by the SYSTEM account.