fabien simonetti
asked on
vbscript and printers : transfer from one server to one another server
Hi,
We have one old server (windows 2003 server) with printers : the name is print01
I install on a new server which the name is "printnew" with share printers.
I defined a vbscript/Active Directory/GPO in order to install on client (windows xp) the printers from printnew.
I unshared printer on print01.
The problem is that on client, users have always old share printers from print01.
I would like to know if it s possible to remove all printers from print01 are removed thanks to a script.
Thanks,
Regards
Lirlandais
We have one old server (windows 2003 server) with printers : the name is print01
I install on a new server which the name is "printnew" with share printers.
I defined a vbscript/Active Directory/GPO in order to install on client (windows xp) the printers from printnew.
I unshared printer on print01.
The problem is that on client, users have always old share printers from print01.
I would like to know if it s possible to remove all printers from print01 are removed thanks to a script.
Thanks,
Regards
Lirlandais
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a million
ASKER
thanks you
on small advantage I even delete mappings on the made on the IP
but the other script is cleaner :)
m a r c
'on error resume next
'-------------------------
' Object Creation
'-------------------------
Set WshNetwork = WScript.CreateObject("WScr
Set WshShell = WScript.CreateObject("WScr
'-------------------------
' Main
'-------------------------
DeleteNetPrinters("\\192.1
DeleteNetPrinters("\\serve
'-------------------------
' Clean up
'-------------------------
Set oPrinters = Nothing
Set WshNetwork = Nothing
wscript.quit(0)
Sub DeleteNetPrinters(ByVAl PrinterServer)
'-------------------------
' Description: Deletes any Network Printer Present
' Parameters: begging of printer server url
'-------------------------
Set oPrinters = WshNetwork.EnumPrinterConn
For i = 1 to oPrinters.Count Step 2
If Lcase(Left(oPrinters.Item(
WshNetwork.RemovePrinterCo
End If
Next
Set oPrinters = Nothing
End Sub