Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Printers not getting removed from the client when deselected in FOG web interface #90
Following up this post in the forums. I am able to replicate this issue on a Windows 7 32 bit system. I am fairly sure this applies to 64 bit version as well.
Adding debug statements to the code I found that WindowsPrinterManager.GetPrinters() does not return a list of currently installed printers as we would expect.
To me this seems to be caused by FOGService running as local system account whereas the printers/printer connections are obviously only visible in the user context. Try running the following VBscript as normal user (double click or
Set objNetwork = CreateObject("Wscript.Network") Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colPrinters = objWMIService.ExecQuery ("SELECT* FROM Win32_Printer") For Each objPrinter In colPrinters WScript.Echo objPrinter.Name & vbCrLf Next WScript.Echo "done"
Running it as user I get both local printers and the network printer configured by the FOG client. But as local system account I only get the local printers.
Alright, here is a first test DLL which reads printer information from the registry instead of using WMI calls. This works great on my test VM - win7 32 bit.