Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


November 2001

Automatically Moving Users to a New Print Server

RSS
Subscribe to Windows IT Pro | See More Printing Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Our office needed to take down and replace our aging print server. The server had 25 Data Link Control (DLC) and TCP/IP printers attached to it. I used the simple registry technique that Sean Daily discusses in the sidebar "Poor Man's Consolidation Toolkit" in "Making the Case for Server Consolidation" (May 2000) to successfully move the printers to the new server.

Rather than have my IT staff manually reconfigure our company's 200 workstations to print to the new printers, I scripted the process. I used the Microsoft Windows 2000 Resource Kit's prnmgr.vbs and prnadmin.dll utilities and the Windows NT Zero Administration Kit (ZAK) con2prt.exe tool to develop the script in Listing 1 to check users' network printer connections and redirect and connect users to the corresponding new printer.

First, the script copies the files prnmgr.vbs, prn-admin.dll, and con2prt.exe onto each workstation. Using prnmgr.vbs to list all the network printers attached to a workstation, then parsing that information to a text file lets the for statement connect a user to a new printer.

Initially, you need to input and map the old print servers to the new ones. To expedite this task, you can use prnmgr.vbs to obtain a list of all the printers attached to a network print server, then use a spreadsheet or text editor to match the old print servers to the new ones.

End of Article



Reader Comments
Getting an 'invalid character' when attempting to run this vbs script. VB is showing the % character as invalid.

Steve November 09, 2001


Good article. Q: Does this procedure work for Win9x clients as well? Specifically, do the ResKit tools and CScript work on Win95, Win98, and ME?

Kirk January 25, 2002


Works great when printername is about 18 characters or so. Our printers are typically:
xxx.state.de.us\very_long_printer_name
I wonder if this is a limitation of chgprint.exe?
The chgprint filedate here is Feb99. I'm looking for a newer version. Still a great app!...

TommyS January 24, 2006 (Article Rating: )


If I wanted to take this script and have it further parse out different printer names and run for each printer found without having to go back and edit the script for printers how would this work?

I can use FOR /F "tokens=2,2 delims=\ " %%i in (\\jerry\scripts\parseprint.txt) do @echo %%i>>\\jerry\scripts\parseprint2.txt and get the printer names into a file

How would I further change FOR /F %%i in (\\jerry\scripts\parseprint.txt) do if "%%i"=="\\foghorn\Wayland" prnmgr -dc -b "\\foghorn\Wayland"
con2prt /cd "\\hfsprint\wayland"

To pull each printer name out and make the changes as needed?

Warlords August 29, 2006 (Article Rating: )


It's all looking good so far but I'm a little confused.
Granted, con2prt will set the default printer, but I can't see anywhere in the script that determines what your default printer already is / was, in order for con2prt to set the correct corresponding new printer.

Sorry if I'm being a bit dumb here, but I'm a scripting pygmy. :-)

funchski November 21, 2006 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

New Microsoft/Yahoo! Deal? No

On Sunday, the Times of London reported that Microsoft had renewed talks with failing Internet giant Yahoo! and would manage its search engine for 10 years, while Yahoo! would retain control of its email, messaging, and content services. This report ...

How can I stop and start services from the command line?

...


Task Automation Whitepapers Essential Guide to E-discovery and Recovery for Microsoft Exchange

Continuous Data Protection and Recovery for Microsoft Exchange

Protecting (You and) Your Data with Exchange Server 2007

Related Events Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Patch Management

Related Task Automation Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing