Search code examples
networkingprinterslocalsystem

Unable to access network printers from windows service which runs under LocalSystem account


We are setting up a Windows Service that will need to have access to network printers. I get all the network printers from the below code from console application which by default runs with my domain credentials. However, from my Windows service which runs under LocalSystem Account the below code fails to get the network printers. If I change the windows service to run with domain credentials instead of LocalSystem, then it works. I need to understand what will be the solution to get all the network printers when the service is still running under LocalSystem account.

“System.Drawing.Printing.PrinterSettings.InstalledPrinters;”


Solution

  • IIRC, LocalSystem doesn't have access to network resources by design. It only has access, and a rather high access at that, for the local computer.