3

I am looking for a solution to export settings which were made on a specific printer which uses for example a "CAB A3 300DPI" Driver and import them afterwards on a diffrent device, which is using the same driver. To do that I want to use PowerShell. I am well aware of the PrintUI.dll but this causes too many errors on my side when I try to import the settings on some printers..

I already found a solution to import the "Printing Defaults..." under the menu entry "Advanced" but none yet for the settings for "Preferences..." under the menu entry "General".

For the export and import for the "Advanced"->"Printing Defaults..." I used the following commands found here Copy printer defaults to other printers:

Export:

$somePrinterConfig = Get-PrintConfiguration -PrinterName "xxxxxx" 

Import:

Set-PrintConfiguration -PrinterName "yyyyyy" -PrinterTicketXml     $somePrinterConfig.PrintTicketXML 

Anyway like I said this is just a partial solution since I still need to export and import the printer's "General"->"Preferences..." settings for the printer.

Something mentioned earlier the PrintUI.dll which I used causes errors when importing the settings on some of the printers. For this I used the following here:

Export:

RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n "name_of_printer" /a "path_of_file_to_export.dat"

Import:

RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n "name_of_printer" /a "path_of_file_to_import.dat" 2 7 c d g u

I also should mention that I exported the settings on a Windows Server 2008 Service Pack 2 and imported them on a Windows Server 2012 r2.

Every input in highly appreciated!

Crashme
  • 31
  • 1
  • 1
  • 3
  • "causes to (*too) many errors on my side" - can you be more specific? – Bill_Stewart Feb 21 '17 at 17:10
  • From 200 Printers to import settings on roughly 20 of them couldnt import the settings and the only error message I got was "The operation could not be completed" but other printers with the same driver could have been imported without error. As far as is understood you can only import printer settings with printui to a printer with the same name but I am looking for something which works with every printer as long they use the same driver. – Crashme Feb 21 '17 at 17:35

1 Answers1

0

this is late for you... but I figured out how this works last year and posted it on technet:

This is generally how to export printer configurations using powershell's built in commands and apply them to another printer (It is a powershell replacement for printui dll)

https://gallery.technet.microsoft.com/scriptcenter/Powershell-printer-config-db0465bd

Hope it helps someone here :-)

MithUK

MithUK1
  • 9
  • 1
  • 2
    Can you quote the important parts of the process from the linked site in the answer itself? We want to make sure that your answer is still good even after the link goes bad. – Todd Wilcox Nov 21 '17 at 18:48
  • 1
    @MithUK1 your link is broken, can you post the code here and/or post a github link? – George 2.0 Hope Mar 26 '21 at 20:51
  • -1 link is broken and you couldn't put the important bits in the actual answer. Link rot is a thing. – Killnine Feb 08 '23 at 22:13