How to script printer creation on a Windows Server 2008 R2 clustered print server?
Solution 1
I don't know if this will work in a cluster enviornment, but there is the good old printbrm.exe tool. It creates what is essentially a cab file full of XML that can backup and restore printer setups between servers. This includes the dreaded TCP/IP ports. This might let you do a simple backup, modify the XML to add what you need and let you do a restore to your cluster. (Again, not sure if this is cluster aware).
Printbrm example: http://technet.microsoft.com/en-us/library/cc722360.aspx
rename the file to .cab and extract to disk...
The port file is brmports.xml. I suggest exporting out a printer or two to see how it is "supposed" to look.
Solution 2
printbrn.exe
is capable of exporting all printer configuration including drivers and ports and importing it an another server.
Related videos on Youtube
![Massimo](https://i.stack.imgur.com/fGz6O.jpg?s=256&g=1)
Massimo
"Against stupidity, the Gods themselves fight in vain." https://www.linkedin.com/in/massimo-pascucci
Updated on September 18, 2022Comments
-
Massimo almost 2 years
As per subject.
I've found some ways of scripting printer creation on Windows print servers using WMI, but it looks like WMI doesn't support clustered print servers (or clustered servers at all).
The scripts in
C:\Windows\System32\Printing_Admin_Scripts
are useless because, they are not cluster-aware and end up creating the printers on the active cluster node (just like using WMI).The only tool I found that was able to work on a clustered print server is
printui.exe
(shortcut forrundll32 printui.dll, PrintUIEntry
), but it can't create TCP printing ports: it can only add printers if the port already exists.How can I completely script printer creation (including TCP printing ports!) on a clustered Windows Server 2008 R2 print server?
-
Nixphoe almost 13 yearsHave you tested exporting and importing the registry key HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports ?
-
Massimo almost 13 yearsThat wouldn't work, this is a cluster.
-
-
Massimo almost 13 yearsThis is a server-side configuration... that GPO is for automatical printer configuration for users.
-
Nixphoe almost 13 yearsThey have the same setting under Computer Configuration. I corrected my answer to reflect that. Is that what you're looking for or am I totally not understanding the question?
-
MikeAWood almost 13 yearsThis conversation seem to indicate it might work.. social.technet.microsoft.com/Forums/en-US/winserverClustering/…
-
MikeAWood almost 13 yearsyou could do that using this method, but you'd need to get the data for the printers in the proper format. By adding a few manually and exporting them out, it gives you the necessary driver cab files and examples for each printer def in XML... Remember its not just the ports, but the drivers as well (x86 and x64 in some cases for servers). This just simplifies the process, though its far from easy. Good Luck...
-
Massimo almost 13 yearsI already installed all needed printer drivers, my problem is how to script the creation of actual printers (and printer ports). Looks like there's no working way do to that, though... :-/
-
MikeAWood almost 13 yearsYou can, but you'd need to do it in XML. at least to use this tool... Can Powershell do it? Maybe something along the lines of this: blog.powershell.no/2009/11/07/… not sure if it will work for the cluster out of the box, but it might be worth a look...
-
Massimo almost 13 yearsTried, it doesn't work: WMI doesn't support clusters.