Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printers not available unless shared

We are using classic asp to call a C# dll and in the C# dll we are using System.Drawing.Printing.PrinterSettings.InstalledPrinters to get a list of availabe printers. If the printers are not shared they will not show up when a user trys to print. The Local System account can see and print to them from a VB6 dll and Administrators can print just fine from the C# dll as you might expect. Is there some sort of permissions we need to grant the user so these printers will be available?

like image 219
Ryan Avatar asked Aug 18 '08 15:08

Ryan


2 Answers

As I recall, running a website uses the Network User account, which may not have permission to view local printers.

There was a page on MSDN that said how you can impersonate another user that might have access to the printers, but I've not been able to find it.

Edit: I posted too soon. Here's the page.

HTH

like image 92
Tim Sullivan Avatar answered Oct 13 '22 11:10

Tim Sullivan


I'm fairly certain that impersonating a user or using their credentials does not constitute the ability to see the printers for that user. I believe explorer.exe reconnects all the network resources (shares/printers) upon logon.

like image 25
Joel Lucsy Avatar answered Oct 13 '22 11:10

Joel Lucsy