Windows 7 / Windows Server 2008 R2: PrintBRM

Windows 7 / Windows Server 2008 R2: PrintBRM

  • Comments 3
  • Likes

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 :

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Amazingly bad! You list two switches in the bad that aren't in the summary, or the tool help. There is no real help for x32 to x64 migration. When actually running printbrm, the event log is full of messages that don't list the printer name that causes the problem. There is no mention of cluster issues, from or to.

    Finally, when I run printbrm it crashes the spooler service on import.

  • I have been chasing down an endpoint mapper issue for about a week when printbrm failed to install print queues.  The error was:

    "Printbrm.exe (the Printer Migration Wizard or the command-line tool) failed to restore print queue C2620-PCL5E. The restore process will continue, skipping this queue. Error: 0x800706d9. There are no more endpoints available from the endpoint mapper."

    I rebuilt three print servers thinking this was a configuration issue, chased down any rpc issue I could find, and quite frankly it was the windows firewall.  I am using a third party firewall and when a print share is created it attempts to verify firewall setting using the Firewallapi.dll.  So, I had to enable the windows firewall and run printbrm.exe again.  (For you cluster users, you may also need to create a c$ share.)  See this link for the firewall issue.  <>  See this link for print clusters.  <>  This worked for me.  YMMV.

    I am converting a 2008 (x32) print server to a 2008 r2 (x64) print server.  ~200 queues

    Comments on this tool.  

    1.  Please explain the xml!  To speed up operations I unpacked the backup and changed the following xml:

    FileBRMLDrivers.xml now contains only:


    I then repacked the printerExport file.  This should not be required since I have been using the -NOBIN switch.  (grrr)  I have a prod and a dev print server and this help sync them up a lot quicker.

    2.  The errors have been less than helpful.

    3.  The two GB driver limit cripples this tool.  Could you just allow us to create the xml file directory without the printerExport file?...Or use windows update to pull drivers on restore?  (The cab file size limit breaks copying the drivers if they are over 2gb.  This is pretty easy to exceede since all drivers have a 32 bit and 64 bit version.)  The error does not indicate that you should try a backup without drivers.

    4.  Due to three I had to load all the 64 bit and 32 bit drivers by other means to both servers.  I grabed a list of print drivers and used the following syntax:

    RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /q /c \\prtsrv /m "Canon iR C2620 PCL5c" /h "x64" /v "Windows 2000, Windows XP and Windows Server 2003" /f "%systemroot%\inf\ntprint.inf"

    RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /q /c \\prtsrv /m "Canon iR C2620 PCL5c" /h "x32" /v "Windows 2000, Windows XP and Windows Server 2003" /f "%systemroot%\inf\ntprint.inf"

    Any chance you guys might start packing 32 bit and 64 bit drivers together?

    If your orginal print server exists, you can use this to migrate many of the drivers to your new server from the old server.  A switch on this tool (heh, dll) to check windows update would be very helpful.  I started to create a driver directory to allow me to back this up without an orginal server, but It was not worth the time.

    5.  More switches.  How about backup/restore only print monitors, ports, drivers, or printers.

    So, if I was not so stubborn I would have done this by hand.  But I figured there was an answer....

    John Wagner

    PS:  Thank you for the blog posts on the printbrm.exe tool.

  • If we export print queues using the Wizard in 2008 R2 Print Management MMC. Can we use that to import it to another print server but at the same time we need to keep the existing print server in tact.  Basically, what we are trying to achieve is to have the queues available on another server in the data center in the event this print server fails