Logon Script to change network printers from one server to another

I’m looking to create a logon script in an environment of Win2k and XP Pro on a Windows 2000 domain for changing the server hosting the network share of a printer.  In a small office of 15 users I have a Windows 2000 server sharing the 3 printers in that site.  The 15 users either have one, both, or all three printers in their local profiles with the default printer being different from person to person too.

I’m replacing the existing Win2k server with a new one and would like to change the printers on each client machine without going from computer to computer.  The shared names of the printers on the new server are the same as the old.  How can I create a script to change the server?  The script could be a vbs, wsh, or a batch file; it doesn’t matter to me.

Example:  
User1 on Computer1 has a connection to \\OldServer\Printer1 and \\OldServer\Printer3 under her profile with Printer3 as the default.  

User2 on Computer2 has a connection to \\OldServer\Printer2 and \\OldServer\Printer3 under his profile with Printer2 as the default.  

The ideal script would simply rename \\OldServer to \\NewServer in both scenarios without changing the default printer and without adding a printer they didn’t connect to before.  
gndcdospsAsked:
Who is Participating?
 
jonoakleyConnect With a Mentor Commented:
Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\printserv\DefaultPrinter"
WshNetwork.AddWindowsPrinterConnection PrinterPath
0
 
EdanCommented:
Just out of interest, if you're replacing the old server and taking it off the network, why can't the new server be named identically?
0
 
jonoakleyCommented:
These are VBScript. Respond back if you need help on creating logon scripts.

Add the last line to set as the default printer

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = \\printserv\DefaultPrinter"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath


printserv = your server name
DefaultPrinter= your printer share name
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Dark_KingCommented:
seek for "printui.dll,PrintUIEntry" on www.google.com

or type
rundll32 printui.dll,PrintUIEntry /?
0
 
Dark_KingCommented:
at cmd
0
 
hdhondtCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave a recommendation in the Cleanup topic area that this question is:
Accept jonoakley
Any objections should be posted here in the next 4 days. After that time, the question will be closed.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hdhondt
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.