Windows Server 2008 SP1

Windows Server 2008 SP2

You have a lot of print queues that you want to add, you want to use a command line to do this.

You notice that the built-in script prnport.vbs does not create the ports:

C:\Windows\System32\Printing_Admin_Scripts\en-US>cscript prnport.vbs -s VirtualP
rintServerName -r IP_1.2.3.4

The solution is to do the following:

1.  On a standalone Windows Server 2008 or the physical nodes of one of the clusters.

Create the ports using prnport.vbs

2.  Use PrintBRM to backup the standalone W2K8 print server and restore to the virtual printer name of the W2K8 Failover Cluster.

Hope this helps,



C:\Windows\System32\Printing_Admin_Scripts\en-US>cscript prnport.vbs /?
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Usage: prnport [-adlgt?] [-r port][-s server][-u user name][-w password]
               [-o raw|lpr][-h host address][-q queue][-n number]
               [-me | -md ][-i SNMP index][-y community][-2e | -2d]
-a     - add a port
-d     - delete the specified port
-g     - get configuration for a TCP port
-h     - IP address of the device
-i     - SNMP index, if SNMP is enabled
-l     - list all TCP ports
-m     - SNMP type. [e] enable, [d] disable
-n     - port number, applies to TCP RAW ports
-o     - port type, raw or lpr
-q     - queue name, applies to TCP LPR ports only
-r     - port name
-s     - server name
-t     - set configuration for a TCP port
-u     - user name
-w     - password
-y     - community name, if SNMP is enabled
-2     - double spool, applies to TCP LPR ports. [e] enable, [d] disable
-?     - display command usage

prnport -l -s server
prnport -d -s server -r IP_1.2.3.4
prnport -a -s server -r IP_1.2.3.4 -h -o raw -n 9100
prnport -t -s server -r IP_1.2.3.4 -me -y public -i 1 -n 9100
prnport -g -s server -r IP_1.2.3.4
prnport -a -r IP_1.2.3.4 -h

The last example will try to get the device settings at the specified IP address
If a device is detected, then a TCP port is added with the preferred settings fo
r that device.