Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

April 25, 2006 12:00 AM

Per-Machine Printer Connections + Custom Plug-In

The result is an easy way to manage your network printers
Windows IT Pro
InstantDoc ID #49741
Rating: (17)
Downloads
49741.zip

Managing printers is an unexciting but unavoidable responsibility for Windows systems administrators. Microsoft has put a lot of work into the Windows GUI to make printers easier to find and install, but users are still responsible for adding the printers they need to use. When printers are located together geographically or when users always log on to the same computers, adding printers can potentially be a one-time event. However, when users log on to computers in different geographical areas, adding printers can become a fairly regular occurrence. Depending on the number of users and their level of sophistication (or lack thereof), finding and installing printers can generate a lot of Help desk calls.

One reason why users might need help is that Windows' Add Printer wizard only adds printers to the current user's profile. Unfortunately, there's no option in the GUI to log on as an administrator and add one or more printers that will appear for all users. The problem gets even more complicated when a print server needs to be upgraded or replaced and users have to add the new and delete the old printers.

Microsoft must have recognized this limitation, so starting in Windows 2000, it introduced the ability to add per-machine printer connections to a computer. A per-machine printer connection is a network printer connection that appears for all users. This capability lets you add a printer to a computer only once, and any user that logs on to the computer sees the printer. Users only need to be shown how to set their default printer. In addition, in cases in which a print server is replaced, you can simply delete the old per-machine printer connections and add the new per-machine printer connections. In this scenario, users no longer need to worry about adding and deleting their own printers if the required printers are already available to them.

Strangely, this useful capability isn't well documented. Even worse, the only way to take advantage of per-machine printer connections is to type long, cumbersome commands. For example, to add the printer \\PS3\HP 4600dn as a per-machine printer connection to the computer COMPUTER2, you have to type the command

/c\\COMPUTER2 /ga 
/n"\\PS3\HP 4600dn" 

To list the per-machine printer connections on COMPUTER2, you have to run the command

rundll32 printui.dll,PrintUIEntry
  /c\\COMPUTER2 
  /ge /f"C:\Printers.txt" 

This command saves COMPUTER2's list of per-machine printer connections in a text file named C:\Printers.txt. However, this file contains more than just the printer names, so you have to edit or parse it to extract just the printer names.

As you can see, the command-based interface for managing per-machine printer connections is awkward. I needed a better solution, so I created the PMPMgr plug-in that lets me manage per-machine printer connections more easily. This plug-in consists of a Windows Script Components (WSC) file named PMPMgr.wsc and a script named PMPMgr.js. The PMPMgr plug-in provides an easy-to-use command-line interface for managing per-machine printer connections. You can download the PMPMgr plug-in by clicking the Download the Code button at the top of the Web page. To use this plug-in, you don't need to adapt the PMPMgr.wsc and PMPMgr.js files in any way. You just need to perform four steps:

  1. Register PMPMgr.wsc.
  2. Learn the PMPMgr.js command-line syntax.
  3. List the shared or per-machine printer connections.
  4. Add or delete per-machine printer connections.

STEP 1: Register PMPMgr.wsc
Before you can use the PMPMgr plug-in to manage your per-machine printer connections, you must register the PMPMgr.wsc component. The registration process adds the registry entries that make the component's object available to the system. To register the component, right-click the PMPMgr.wsc file in Windows Explorer and choose Register. Alternatively, you can register it from the command line with the command

regsvr32 /i:"[path]PMPMgr.wsc" 
  %SystemRoot%\system32\scrobj.dll 

where path is the path to the component on your system. (Although this command appears on several lines here, you would enter it on one line in the command-shell window. The same holds true for the other multiline commands in this article.) Conversely, if you want to unregister the component, right-click the PMPMgr.wsc file and choose Unregister. To unregister it from the command line, type the command

regsvr32 /u /n /i:"[path]PMPMgr.wsc" 
  %SystemRoot%\system32\scrobj.dll 

To run either command without displaying the dialog box message, add the /s option immediately after regsvr32 in the commands just given. You must be a member of the local Administrators group to register or unregister the component.

Related Content:

ARTICLE TOOLS

Comments
  • Anne
    4 years ago
    Jun 25, 2008

    To all who couldn't download the code: This article was formerly subscriber-only, so if you weren't a Windows IT Pro subscriber, you could not access the code or read the entire article. I've made the article available to registered users for a limited time so you can download the code and read the full article. Note that if you aren't a subscriber, for only $5.95 you can get a monthly pass that will let you access all subscriber-only articles for 30 days. (See link at the top of the page.) Thanks for reading!

  • Brian
    4 years ago
    Jun 25, 2008

    Yes, where is the download. I don't see it on this site and have got on this site and checked for at least 4 different times.

  • pennykristy
    6 years ago
    Aug 22, 2006

    HOW CAN DOWNLOAD THE TOOLS.

  • STEVEN
    6 years ago
    Jul 05, 2006

    Just played around with this and I think it'll be incredibly useful in my enviroment (1,000 users spread over 48 locations). The login script / GPO solution might work if you have the time and/or staff to devote to it, but this is quick, simple and easy. Now, new machines we configure can go out with all printers easily without adding by hand. Or, when we replace a server, we can easily update all the clients' printers. Love it! Thanks!

  • Matt
    6 years ago
    Jun 08, 2006

    Still trying to locate the download link. I would really like to know where the others found the files to test with. Please assist.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.