[英]WCF Service running under app pool impersonating domain user account prints to network printer for one domain account but not another
I am using Windows Server 2016. Running on Windows 10 machine. 我正在使用Windows Server2016。在Windows 10计算机上运行。
We had a system administrator who recently left our company. 我们有一位系统管理员,他最近刚离开公司。 He set up the web server so I had rights to it and such.
他设置了Web服务器,因此我有权使用它。 If I impersonate my own domain account on the app pool running my WCF service, the service can successfully print to the network printer.
如果我在运行WCF服务的应用程序池上模拟自己的域帐户,则该服务可以成功打印到网络打印机。
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. 我有一个同事创建了一个新的域帐户,该帐户的目的是被应用程序池用于模拟,以便万一我离开公司,wcf服务可以打印到网络打印机。 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. 它使用System.Drawing.Printing.PrintDocument.Print(),并且在打印调用上没有异常,它挂起了几秒钟,该作业显示在打印队列中,并且很快消失而不进行打印。
I was just wondering if this last piece could be the reason for the WCF service failing to print? 我只是想知道这最后一块是否可能是WCF服务无法打印的原因?
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. 因此,在与IT部门的另一个人一起工作之后,我发现它不起作用的原因是该服务器尚未设置为打印服务器,因此将其添加到Web服务器之后,便能够发送和发送电子邮件。打印。
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. 当它在我下面运行时,它会将打印作业重定向到我的本地计算机,这就是它能够打印的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.