What is the best approach to setting a default printer?

0

I have an application that needs to change the default printer but I am having problems getting this to work for an AD account. It will work for a logged on user but not an AD account. Is there a GPO setting I need to look into or some other reason this is not working?

I have tried the following running as the AD account:

  • PrintUI.dll
  • Printing Admin Script
  • VS test application
  • Setting the default printer from the print dialog panel of an application such as Notepad

Below are the commands etc I used

  • RUNDLL32.exe PRINTUI.DLL,PrintUIEntry /in \\PrintServer\Printer
  • cscript prnmngr.vbs -t -p "\\PrintServer\Printer"
  • Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "SetDefaultPrinterA" (ByVal pszPrinter As String) As Boolean

Everything works as expected when I run these commands/apps but fails when run as AD account.
PrintUI.dll gives Operation could not be completed (error 0x00000709)
Printing Admin Script gives a Win32 error code 1801
VS test application fails without notification.
Notepad gives Operation could not be completed (error 0x00000709)

I did find a way to "hack" the registry but I really don't want to go down that route.
This is driving me mad, it must be possible.

printing

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0