Printing from windows service

  • Thread starter Thread starter M.
  • Start date Start date
M

M.

Hi.

I need to print to a network printer (shared) from
windows Service. Is this possible?

I'm using PrintDocument and I get access denied exception
after calling Print () method.

Thanks for answer.

Regards
Marek
 
You should check that the user that your service uses has sufficient rights
to print to that printer. To find out which user the service uses, go to
Computer Management, Services node, then find your service in the list and
display the properties. In the Log On tab, check the user settings.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
Thank you very much Jan!

The problem was, I've run this service under LocalSystem account, that
doesn't have access to shared resources, such as printers.

Now, I'm running this service as an member of administrators, and everything
is ok.

M.
 
Of course, you should probably make a new user for the service so it doesnt
have complete administrator priveledges... bad security problem there...
 
Back
Top