Here's a real simple script if you are in the process of migrating from 1 windows printer server to another. (or if you ever want to migrate from 1 printer share to a new printer share)
Run this as part of a login script, or interactively.
Rememeber to change line 7 of the script to note the name of your INPUT file. Format of file is simple TXT file, (i use CSV extension so you can modify in excel). Make sure input file is in same directory as script.
Format is as follows:
\\OLDSERVERNAME\OLDPRINTERSHARENAME, \\NEWSERVERNAME\NEWSHARENAME
\\SERVERNAME\OLDPRINTERSHARENAME, \\SERVERNAME\NEWSHARENAME
Enjoy
-E
On Error Resume Next
' PrintSwap vbs - Author, Eric Davis- edavis6678 -at- Y a h o o . com
Dim oNetwork, oFso, oShell, InputFileName
Set oShell = WScript.CreateObject("WScript.Shell")
Set oNetwork = WScript.CreateObject("WScript.Network")
Set oFso= CreateObject("Scripting.FileSystemObject")
InputFileName = "redirect_list.csv" ' Make sure this files is located in SAME directory as this script
'Format of files is as follows
'\\OLDSERVERNAME\OLDPRINTERSHARENAME, \\NEWSERVERNAME\NEWSHARENAME
'\\SERVERNAME\OLDPRINTERSHARENAME, \\SERVERNAME\NEWSHARENAME
Set oPrinters = oNetwork.EnumPrinterConnections
For i = 0 to oPrinters.Count - 1 Step 2
Print = oPrinters.Item(i)
PrintDev = oPrinters.Item(i+1)
'########## CALL TO CHECK PRINTERS AND CHANGE IF NECESSARY
Call ReMapPrinter(PrintDev)
Next
'End of Script
Sub ReMapPrinter(OldPrinter)
booldontadd = 0
sScriptDir = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - Len(WScript.ScriptName)) ' Path of script
InputFile = sScriptDir & "\" & InputFileName ' path of inputfile
Set TempFile = ofso.openTextFile(InputFile) ' read through file
While Not TempFile.atendofstream
TextLine = Trim(TempFile.Readline)
aryLine = Split(TextLine,",")
printerpath = lcase(aryLine(1))
If printerpath = "" Then ' If printer is listed, but no value given for new printer then just remove old printer
booldontadd = 1
Else
booldontadd = 0
End If
oldprinterpath = lcase(aryLine(0))
If lcase(OldPrinter) = oldprinterPath Then
' get current default printer
DefaultKey = LCase(oShell.RegRead("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"))
DefPrinter = Split(DefaultKey, ",")
If booldontadd = 0 Then ' must have new target, if none, printer removed.
oNetwork.AddWindowsPrinterConnection printerpath
End If
oNetwork.RemovePrinterConnection oldprinterPath ' remove old printer
If DefPrinter(0) = oldprinterpath Then
oNetwork.SetDefaultPrinter PrinterPath ' if it was the default, reset it back to default
End If
End If
Wend
End Sub