Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2005

Tip: Looking for answers? Try searching our database.

Using ImpersonateLoggedOnUser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
D - 27 Feb 2005 23:22 GMT
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.
Alvin Bruney [Microsoft MVP] - 28 Feb 2005 00:22 GMT
It depends on how exactly the print call is being made. If it invokes
another process, that process will run under the worker process account.
Bruce baker wrote some code to fix this issue in here a couple weeks ago
using the .NET API, have a google for it.

Signature

Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
--------------------------------------------------

> We have a .NET application implemented as a Windows
> service in order to perform impersonation for the purposes
[quoted text clipped - 24 lines]
>
> Thanks in advance.
D - 28 Feb 2005 16:53 GMT
Thanks for the reponse.

I was not able to find the code you are referring to. Do
you have more specific information on how to locate it?

>-----Original Message-----
>It depends on how exactly the print call is being made. If it invokes
[quoted text clipped - 32 lines]
>
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.