programming4us
         
 
 
Windows Server

Windows Server 2008 : Migrating Printers with printbrm, Controlling the Print Queue with prnqctl.vbs

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
7/12/2013 7:53:27 PM

1. Migrating Printers with printbrm

You can migrate printers from one print server to another print server with the printbrm.exe tool. The tool is located in the c:\windows\system32\spool\tools folder. This tool can be used to back up, restore, and migrate printer information.

Note

Because this path is not known to Windows by default, you either need to include the path in the command or change the directory before executing the command. For example, you can change to the directory with the command cd \windows\system32\spool\tools.


The switches you use are listed in the following table.

Note

Because printbrm.exe is an executable file (not a script like pubprn.vbs), the cscript command is not needed.


printbrm SwitchesComments
Target server.
-s \\server-name
-s \\dc1

The -s identifies the server that holds the printer information.
File name.
-f file-name.printerexport
-f printers.printerexport

You can name the file whatever you want, but the extension must be printerexport.
Backup printer information.
-b
printbrm -s \\source-computername
-b -f file-name.printerexport
C:\>c:\windows\system32\spool\
tools\printbrm -s \\dc2 -b -f
printers.printerexport

Backs up the printer information to a file. The example command retrieves the printer information from DC2 and stores it in a file named printers.printerexport.
Query the file.
-q
printbrm -q -f
filename.printerexport
C:\>c:\windows\system32\spool\
tools\printbrm -q -f
printers.printerexport

You can query the contents of the file with the -q switch. It displays a listing of print queues, printer drivers, printer ports, and print processes contained in the file.
Restore printer information.
-r
printbrm -s \\target-computer-r
-f filename.printerexport
C:\>c:\windows\system32\spool\
tools\printbrm -s \\dc1 -r -f
printers.printerexport

Restores the configuration information from the file to a server. The example reads the data from the file named printers.printerexport and restores it on the server named DC1.

The following steps show how to migrate printers from one print server (named DC2) to another print server (DC1). You can execute both commands on either DC1 or DC2.

StepAction
1.Back up the printers stored on the source computer (DC2) to a file named dc2printers.printerexport with this command:
C:\>c:\windows\system32\spool\tools\printbrm -s \\dc2 -b -f
dc2printers.printerexport

2.Migrate the printers to the target computer with the following command:
C:\>c:\windows\system32\spool\tools\printbrm -s \\dc1 -r -f
dc2printers.printerexport

2. Controlling the Print Queue with prnqctl.vbs

The prnqctl.vbs script can be used to control the print queue on local and remote computers. The script is located in the c:\windows\system32\printing_admin_scripts\en-us folder. You can use it to pause printing, resume printing, cancel all printing, and print a test page. The basic syntax is as follows:

cscript prnqctl.vbs option -p printer-name
[-s remote-computer] [-u user-name -w password]

Tip

The printer-name is the actual name of the printer, not the share name.


The following table shows some uses of this script.

Note

In the following table, the path was changed to the location of the prnqctl.vbs script with the following command:

cd \Windows\System32\Printing_Admin_Scripts\en-US.


prnqctl CommandComments
Pause printing.
-z
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -z -p "HP Officejet
5600 series"
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -z -s dc2 -p "HP
Officejet 5600 series"

The -z switch causes the printer to pause.

In the first example, the local printer named HP Officejet 5600 series is paused. Because the printer name has spaces in it, it must be enclosed in quotes. Figure 1 shows the result after executing this command. The printer is paused.

The second example pauses the printer on a server named dc2.

Note

When using the -s switch to connect to a remote computer, the user’s credentials are used. If the user doesn’t have permissions, the -u and -w switches must be used to add a username and password.

Add a username and password.
-uusername  -wpassword
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -z -s dc2 - p "HP
Officejet 5600 series" -u
pearson\administrator -w P@ssw0rd

This example pauses the printer on the remote system named dc2 using different credentials.
Resume printing.
-m
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -m -p "HP Officejet
5600 series"
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -m -s dc2 -p "HP
Officejet 5600 series"

The -m switch resumes the printer. The first example resumes the local printer. The second example resumes the printer on a remote server named dc2.
Cancel all printing.
-x
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -x -p "HP Officejet
5600 series"
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -x -s dc2 -p "HP
Officejet 5600 series"

The -x switch cancels all print jobs spooled to the printer. The first example resumes the local printer. The second example resumes the printer on a remote server named dc2.
Print a test page.
-e
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -e -p "HP Officejet
5600 series"
C:\Windows\System32\Printing_
Admin_Scripts\en-US>cscript
prnqctl.vbs -e -s dc2 -p "HP
Officejet 5600 series"

You can send a test page to the printer with the -e switch. The first example resumes the local printer. The second example resumes the printer on a remote server named dc2.

Figure 1. HP Officejet 5600 series printer paused from prnqctl.vbs command

Other -----------------
- Windows Server 2008 : Publishing Printers to Active Directory with pubprn.vbs
- Windows Small Business Server 2011 : Deploying Network Printers (part 4) - Sharing a Printer
- Windows Small Business Server 2011 : Deploying Network Printers (part 3) - Creating a DHCP Reservation for a Printer
- Windows Small Business Server 2011 : Deploying Network Printers (part 2) - Installing a Network-Attached Printer, Installing a Network Printer Manually
- Windows Small Business Server 2011 : Deploying Network Printers (part 1) - Creating a Printer - Installing a Local Printer Manually
- Windows Small Business Server 2011 : Sharing Printers- Understanding Windows Printing
- Windows Home Server 2011 : Getting More Out of Control Panel (part 2) - Alternative Methods for Opening Control Panel Icons
- Windows Home Server 2011 : Getting More Out of Control Panel (part 1) - Understanding Control Panel Files
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 3) - Increasing the Size of the Recent Documents List, Enabling the Shutdown Event Tracker
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 2) - Customizing the Places Bar
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 1) - Working with Group Policies, Customizing the Windows Security Screen
- Windows Server 2012 : Backup and Recovery (part 8) - Backing up and restoring Active Directory
- Windows Server 2012 : Backup and Recovery (part 7) - Backing up and recovering your data - Recovering data stored on another server, Recovering the system state
- Windows Server 2012 : Backup and Recovery (part 6) - Backing up and recovering your data - Tracking scheduled and manual backups, Recovering your data
- Windows Server 2012 : Backup and Recovery (part 5) - Backing up and recovering your data - Performing a one-time backup
- Windows Server 2012 : Backup and Recovery (part 4) - Backing up and recovering your data - Scheduling backups
- Windows Server 2012 : Backup and Recovery (part 3) - Backing up and recovering your data - Using the backup utility, Backing up your data
- Windows Server 2012 : Backup and Recovery (part 2) - Developing backup strategies
- Windows Server 2012 : Backup and Recovery (part 1) - Disaster-planning strategies, Disaster preparedness procedures
- Installing Windows Server 2012 and Server Core : Managing and Configuring a Server Core Installation
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Celebrity Style, Fashion Trends, Beauty and Makeup Tips.