How can i change clients printers to look at new print server

J

Jeff

Hi,

I was wondering if there was an easy way to remap printers
to a new print server automatically and remove all old
printers. The same share names exist on both servers for
the printers.

Thanks,
Jeff
 
M

Marc Junker

Jeff,
I had to perform the same thing on my company's computers
so I created a vb script that remaps the client computers
printers. Copy the script code into a txt file and rename
the extension to .vbs. The client machine needs to have
the latest WMI and WSH installed on it. The script will
remap the users installed printers and delete the old
mappings. Of course the downfall of using a script is the
user has to be logged on at the time. I ended up using SMS
to distribute and run the script during the users log on.

Start the copy from 'run:

'run this vbscript on the client computer. The most
current WSH and WMI need to be installed on the client
machine.
On Error Resume Next
strComputer = "."
WSHversion = WScript.Version
'Check to see the computer has the latest Windows Script
Host installed
If WSHversion = "5.6" Then
Set objWMIService = GetObject("winmgmts:\\" & strComputer
& "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Printer",,48)
pServer = (objItem.ServerName)
For Each objItem in colItems

pShare = objItem.ShareName
pServer = UCase(objItem.ServerName)
'Change the \\wtprint01\ to your new print server
nServer = "\\WTPRINT01\"
cPrinter = pServer & "\" & pShare
nPrinter = nServer & pShare
cName = objItem.Name
' MsgBox("Current Servername is " & pServer)
'Change the \\wtprint02 to the existing printer server
If pServer = "\\WTPRINT02" Then
Set npc = CreateObject("WScript.Network")
npc.AddWindowsPrinterConnection nPrinter
Set rpc = WScript.CreateObject("WScript.Network")
' MsgBox(cPrinter)
'this will remove the old printer connections
rpc.RemovePrinterConnection cPrinter, True, True
Else
End if
' MsgBox(cPrinter)
Next
End if

Thanks,
Marc Junker
 
D

Dennis316

The script works great. However, how do you keep the same "default
printer on the new server??


-
Dennis31
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top