Windows 7 / Windows Server 2008 R2: PrintBRM

Vista Pearl Happy Friday everyone!  Welcome to Day Nine of our Launch Series for Windows 7 and Windows Server 2008 R2.  We’re continuing on with Printing today – specifically a look at PrintBRM.  PrintBRM was introduced in Windows Vista and Windows Server 2008 as the replacement for the PrintMig utility.  PrintBRM allows you to backup, restore and migrate print queues, printer setttings, printer ports and language monitors.  Windows 7 and Windows Server 2008 R2 introduce some new enhancements to PrintBRM designed to provide more flexibility and better instrumentation, for example:

  • Better error handling and reporting
  • Ability to perform a partial restore of print objects from a backup
  • Option not to restore security settings for print queues during a restore
  • Migration of Print Driver Isolation settings

Let’s dive in with a brief overview of the PrintBRM architecture.  PrintBRM can be invoked using command line parameters or from a UI (normally invoked from the Print Management Console).  The export / import functionality is accomplished using print API’s and is implemented in the following binaries:

  • Printer Migration Wizard: PrintBRMUi.exe (%systemroot\system32)
  • Command Line Tool: PrintBrm.exe (%systemroot\system32\spool\tools)
  • COM Proxy / Stub: PrintBrmPs.dll (%systemroot\system32\spool\tools)
  • DCOM Server: PrintBrmEngine.exe (%systemroot\system32\spool\tools)

A backup or export operation using PrintBRM produces a compressed file that is used for the restore or import operation.  The following XML files are part of the export file in addition to the individual printer driver and configuration files:

  • BrmDrivers – contains a list of every driver installed on the computer and the driver files for each driver
  • BrmForms – contains a list of all the installed forms
  • BrmLMons – will usually contain either Windows NT x86 or Windows x64 as the architecture and a list of port monitors and the port monitor files installed
  • BrmPorts – contains a list of all the installed printer ports
  • BrmPrinters – contains a list of all printers that have been installed
  • BrmSpoolerAttrib – contains information about the spooler directory path and also indicates whether or not the source server was a cluster server

As I mentioned before there are a number of PrintBRM enhancements.  The first is that there have been a number of general improvements regarding the reporting and handling of error conditions during the backup and restore processes.  The reporting is primarily logged to the Event Viewer under Custom Views\Printer Migration Events.  Beyond the error reporting improvements though, there are some key functionality pieces to be aware of.  The first one is a Selective Restore feature (only available via the command line) that allows administrators to selectively restore printers and their related objects.  The appropriate switch to use with the PrintBRM command is –D.  The meaning of the switch does depend on whether it is used with the –R (restore) or –B (switch).  The high level process looks like this:

  1. Export printer objects from the source server
  2. Perform a restore to a temp folder using the –D switch
  3. Manually edit the files in the temp folder
  4. Perform a backup of the temp folder using the –D switch
  5. Import the modified backup file to the target server

In addition, there may be situations where restoring the security settings for print queues may not be desirable – for example moving the print server to a different domain.  The PrintBRM command line utility provides the flexibility to prevent the restoration of print queue ACL’s.  There is a new switch for this, the –NOACL switch.  If this switch is used, the restored print queues will inherit the permissions of the target print server.

We looked at Print Driver Isolation in our last post – the new PrintBRM tool allows you to export / migrate the Print Driver Isolation settings.  These settings along with other spooler settings are exported in BRMSpoolerAttrib.xml.  The following line is added to the XML file with the current driver isolation settings: <DriverIsolation value=”<PrintDriverIsolationGroups>”/>.  The value for  <PrintDriverIsolationGroups> comes from the registry key value HKLM\System\CurrentControlSet\Control\Print\PrintDriverIsolationGroups.  This string value can be manipulated in the XML file prior to the import / restore operation if needed.

There are some things to keep in mind when managing migrations.  The first is that a print queue cannot function without the native printer driver for the server architecture (x86 or x64) on which it exists.  Since Windows Server 2008 R2 is a 64-bit only operating system, it is important that you have 64-bit drivers installed for all of your printers if you are migrating from a 32-bit system.  The most difficult transition is from 32-bit to 64-bit servers in an organization with 32-bit clients since it is common to have third-party 32-bit printer drivers that do not have 64-bit equivalents.  During the print configuration restore for cross-platform scenarios, if the backup file does not contain driver binaries for the platform of the target server, the drivers will be installed from the target server’s driver store, if available.

Before we wrap up, here’s a quick breakdown of the PrintBRM command parameters:

Option Description
-B Backup the server to the specified file
-R Restore the configuration in the file to the server
-Q Query the server or the backup file
-S <server name> Target server
-F <file name> Target backup file
-O FORCE Force overwriting of existing objects
-P ALL | ORIG Publish all printers in Active Directory or publish printers that were published originally
-NOBIN Omit the binaries from the backup
-LPR2TCP Convert LPR ports to Standard TCP/IP ports on restore
-C <file name> Use the specified configuration file for BRM

And that brings us to the end of today’s post.  Tomorrow we’ll be covering Location-Aware Printing, and your host will be … well, me!  Until next time …

CC Hameed


Share this post :