You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 wscript.exe C:\path\to\printer.vbs from cmd.exe) and under local system privileges (this is done using PsExec.exe -i -s cmd.exe /C wscript.exe C:\path\to\printer.vbs, see here):
SetobjNetwork=CreateObject("Wscript.Network")SetobjWMIService=GetObject("winmgmts:\\.\root\cimv2")SetcolPrinters=objWMIService.ExecQuery("SELECT* FROM Win32_Printer")ForEachobjPrinterIncolPrintersWScript.EchoobjPrinter.Name&vbCrLfNextWScript.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.
The text was updated successfully, but these errors were encountered:
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.
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
wscript.exe C:\path\to\printer.vbs
from cmd.exe) and under local system privileges (this is done usingPsExec.exe -i -s cmd.exe /C wscript.exe C:\path\to\printer.vbs
, see here):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.
The text was updated successfully, but these errors were encountered: