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?

18.08.2008 15:00:54
I'm not sure what exactly you mean. Perhaps the administrator can do that because he himself is logged in, or because the printers that a particular user can see are stored as entries in the registry.
Joel Lucsy 20.08.2008 00:29:03
2 ОТВЕТА

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

4
18.08.2008 15:15:06
I'm pretty sure it's running with the user's credentials. In SQL Profiler my queries are using the user's credentials. Granting the Network Service account access to the printer does not solve the problem.
Ryan 26.05.2011 21:08:36

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.

3
18.08.2008 23:09:48
If it only connects when explorer.exe runs then why would the administrators be able to access the printers when no users are logged in?
Ryan 26.05.2011 21:09:10