Using ImpersonateLoggedOnUser

D

D

We have a .NET application implemented as a Windows
service in order to perform impersonation for the purposes
of gaining access to various resources. We are using
ImpersonateLoggedOnUser() instead of the .NET
impersonation API.

Everything works fine except when we call an external COM
component that is supposed to print a report using its
internal API calls. We can access file resources, etc.

We perform impersonation to a valid administrator account,
yet the application fails to print (we wrote debugging
information to make sure that we are impersonating
properly).

The problem appears to be that the external process is
still using the local SYSTEM account, which by default
does not have access to printers (unless the registry is
modified - see http://support.microsoft.com/default.aspx?
scid=kb;en-us;184291). If the registry is modified to
allow printer access to the SYSTEM account, printing works
fine.

We do not want to have to modify the registry to allow
access to printers. Any idea why impersonation is failing
here?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top