Hi,
I understand that you are planning to migrate about 150 printers from one
server to another. You are looking for a way to automate the updating of
the UNC network printers to the new share.
Please download the print migrator tool from the link below which assist
you to migrate the printers from one server to the other.
Print Migrator 3.0
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=D691
5F13-EDE4-4708-83C1-0091EEADE293
The link below provides help information for Print migrator
Help Information for Printmig.exe Version 2.0
http://support.microsoft.com/default.aspx?scid=kb;en-us;275529
Please find a sample VB script file that helps you to redirect the client
to the new network printer share.
Note: Please test it in your environment to make sure it works as expected
before implementing it.
'===========================================================
' NAME: W2kChgPrint.vbs
' COMMENT: This is a sample script
' For the purpose of updating W2K and WinXP clients UNC printers
to a new
UNC
' printer path.
' This script is designed to handle the following format only
' <old UNC printer> <new UNC printer>
' \\server1\shareA \\server2\shareC
' \\server1\shareB \\serverX\ShareB
'
' NOTES:
' Do not add blank spaces. Both original and new UNC printer path must be
included.
' One tab only between original UNC printer path and new UNC printer path
' The line in the script "TranslateFile =..." should be updated
'========================================================
Option Explicit
'On error Resume Next
Dim TranslateFile 'File that stores the old printer path and new printer
path
TranslateFile = "\\systemname\W2K-ChgPrint\translateprinter.txt"
Dim dict 'The dictionary object, dict.item() points to the new printer
Dim Key 'The dictionary key to each item
Dim PrinterPath 'Contains the Path to the original printer, ie
\\server\share
Dim objLocator, objService, objEnumerator
Dim objWSH, strComputerName
Set objWSH = CreateObject("WScript.Network")
strComputerName = objWSH.ComputerName
set objLocator = CreateObject("WbemScripting.SWbemLocator")
set objService = objLocator.ConnectServer(strComputerName,"root/cimv2")
set objEnumerator = objService.ExecQuery("SELECT * FROM win32_Printer")
Set dict = CreateObject("Scripting.Dictionary")
CreateDictionary 'Populate the dictionary object
For each key in objEnumerator
PrinterPath = Ucase(key.ServerName & "\" & key.ShareName) 'enumerated
from local system
If dict.Exists (PrinterPath) Then 'if
PrinterPath matches dictionary item
objWSH.AddWindowsPrinterConnection dict.item(PrinterPath)'Add printer
in
dictionary that matches PrinterPath
If (ucase(GetDefaultPrinter()) = ucase(key.name)) then _
objWSH.SetDefaultPrinter dict.item(PrinterPath)
objWSH.RemovePrinterConnection PrinterPath, true, true 'This line
deletes old
printer
End if
Next
'** This function returns the name of the printer ie "\\server\HP Laser Jet
2100"
Function GetDefaultPrinter()
Dim RegPath 'Location that stores users Default Printer
Dim Loc 'Used to locate the comma after the printer name
Dim DefaultPrinter 'Temporary stores the data read from RegPath
DIM WSHShell 'Windows Scripting Host object
Set WSHShell = WScript.CreateObject("WScript.Shell")
RegPath = "HKCU\Software\Microsoft\Windows
NT\CurrentVersion\Windows\Device"
GetDefaultPrinter="" 'If we error out reading Default printer will be
nothing
On Error Resume Next 'Script should continue running even if registry
data is
not found
DefaultPrinter = WSHShell.RegRead(RegPath)
Loc = instr(3,DefaultPrinter,",",vbTextCompare)
GetDefaultPrinter = Mid(DefaultPrinter,1,loc - 1)
End Function
'** This fuction adds the Translatefile.txt into a dictionary object
'** The original \\server\share is assigned to the dictionary Key (like a
database)
'** The destination \\server\share becomes the associated Item to the Key
'** If you do not like dictionary objects you could use a 2 dimensional
array
instead
Function CreateDictionary()
Dim File, FSO, Line, OrgPrinter, NewPrinter, Loc
Set FSO = CreateObject("Scripting.FileSystemObject")
Set File = FSO.OpenTextFile (TranslateFile, 1)
While not File.AtEndOfStream 'Loop until the end of the file is
read
Line = Ucase(File.ReadLine) 'Read line of text from the file
Loc = instr(1,Line,chr(9),vbTextCompare) 'Find the tab in the line read
if Loc > 3 then 'Do not add line to dictionary if
Tab not
found
OrgPrinter = Mid(Line,1,Loc -1) 'contents before tab is the
original
\\server\share
NewPrinter = Mid(Line,Loc +1) 'Contents after tab is the
destination
\\server\share
dict.Add OrgPrinter, NewPrinter 'adds another set of "Key, Item"
to the
dictionary
end if
WEnd
End Function
===================================================
Hope it helps your issue.
Thank you,
Rashmi
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "(e-mail address removed)" <
[email protected]>
Sender: "(e-mail address removed)"
<
[email protected]>
Subject: Printer Migration
Date: Tue, 25 May 2004 09:28:56 -0700
Lines: 14
Message-ID: <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcRCdV/7SsmClh+XTISrTKApnneqpQ==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.win2000.printing
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.win2000.printing:12702
NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
X-Tomcat-NG: microsoft.public.win2000.printing
Hello All..
Hoping is able to help me with this task I have. I have to
migrate about 150 printers from one server to another. The
difference between both server is that one is named
hcus_ny01 and the new one is named hcusny01, see the
difference we took the underscore out, but the printer
queue's name are the same. The nightmare here is touching
over 1000 desktops to make the change, is there anyway I
could modify the registry to make the change from the old
server with underscore and modify the key to reflect the
new server without the underscore. Would this work? I'm
trying to automate this change on the desktop side. Any
help will be greatly appreciated.