Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop dns driver drivers error ethernet excel freeze gaming graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard network printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Windows Server >
Solved: Print Server Transfer

Reply  
Thread Tools
LinuxHacker's Avatar
Member with 140 posts.
 
Join Date: Dec 1969
16-Oct-2009, 03:42 PM #1
Solved: Print Server Transfer
I have copied all of my network printers to a new print server using Microsoft's Printer Migration Tool. Does anyone know a script or another way to delete all of the end user's network printers (not local printers) from the old server and install the new network printers on the new print server?

I'm too lazy to walk to each machine.
LinuxHacker's Avatar
Member with 140 posts.
 
Join Date: Dec 1969
16-Oct-2009, 04:30 PM #2
I figured it out.

this script will remove old network printers, add new network printers and set default printer to a network printer if a local printer does not exist.





On Error Resume Next

Dim OldPrint, UNCpath1, UNCpath2, UNCpath3, UNCpath4, NewPrint, strComputer, objWMIService, LocalPrinter

UNCpath1 = "\\Fileserver\BrotherW6th"
UNCpath2 = "\\Fileserver\CanoniP6"
UNCpath3 = "\\Fileserver\HPLaser2015"
UNCpath4 = "\\Fileserver\OKIC5300"

Set OldPrint = WScript.CreateObject("WScript.Network")
OldPrint.RemovePrinterConnection UNCpath1, true, true
OldPrint.RemovePrinterConnection UNCpath2, true, true
OldPrint.RemovePrinterConnection UNCpath3, true, true
OldPrint.RemovePrinterConnection UNCpath4, true, true

Set NewPrint = CreateObject("Wscript.Network")
NewPrint.AddWindowsPrinterConnection "\\Fileserver2\BrotherW6th"
NewPrint.AddWindowsPrinterConnection "\\Fileserver2\CanoniP6"
NewPrint.AddWindowsPrinterConnection "\\Fileserver2\HPLaser2015"
NewPrint.AddWindowsPrinterConnection "\\Fileserver2\OKIC5300"

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set LocalPrinter = objWMIService.ExecQuery("Select * From Win32_Printer Where Local = TRUE")

If LocalPrinter.Count = 0 Then
NewPrint.SetDefaultPrinter "\\Fileserver2\HPLaser2015"
End IF

WScript.Quit
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:12 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.