0
votes

I am using Windows Server 2016. Running on Windows 10 machine.

We had a system administrator who recently left our company. He set up the web server so I had rights to it and such. If I impersonate my own domain account on the app pool running my WCF service, the service can successfully print to the network printer.

I had a co-worker create a new domain account who's purpose is to be used for impersonation by the app pool so that the wcf service can print to the network printer in case I ever leave the company. We added the new domain user to the printer and granted it rights, when the app pool is running under this new domain user I can see the job get sent to the printer but it doesn't print. If I switch the app pool back to run under my domain account it prints fine. The only thing I've found which looks different is that under Server Manager -> Print Management -> Print Servers -> Printers -> desired printer, my domain account is listed under the advanced security settings for the printer with special permissions, but the new domain account is not listed. I do not have the permissions to add the new domain account.

This uses System.Drawing.Printing.PrintDocument.Print() and no exception occurs on the call to print, it hangs for a few seconds, the job shows in the print queue and quickly disappears without printing.

I was just wondering if this last piece could be the reason for the WCF service failing to print?

1

1 Answers

0
votes

So after working with another person in the IT department, I found out that the reason this was not working was because the server had not been set up as a print server, so after adding that to the web server, it was able to send and print.

When it was running under me, it was redirecting the print jobs to my local computer and that is why it was able to print.