• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

Remotely uninstall printer and set new default printer

I'm a Win2000 newbie.
Win2000 Server and Win200 Clients within a domain.

I have installed a new printer in our network. The drivers are installed on all clients.
Now I need to set this printer as default printer for ALL USERS that log onto one of the machines.
And I want to uninstall the old printer from ALL the MACHINES.

How can I do this remotely?

Thanks
0
olio
Asked:
olio
  • 2
1 Solution
 
LampjeCommented:
Use this in youre loginsript:

================================================
Function MakePrinter(Printer, Server, Default)

Dim PrinterPath, PrinterDriver
PrinterPath = "\\" & Server & "\" & Printer
PrinterDriver = Printer
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
If Default = True Then WshNetwork.SetDefaultPrinter PrinterPath

End Function
=================================================

Remove one:
=================================================
Function RemovePrinter(Printer, Server)

Dim PrinterPath, PrinterDriver, DelPrint
PrinterPath = "\\" & Server & "\" & Printer
Set DelPrint = WScript.CreateObject("WScript.Network")
DelPrint.RemovePrinterConnection PrinterPath , true, true

End Function
=================================================
0
 
LampjeCommented:
Forgot:
Add:
=================================================
Set WshNetwork = CreateObject("WScript.Network")
=================================================
To MakePrinter
0
 
olioAuthor Commented:
The printers are on a peer-to-peer network, i.e. directly (though TCP/IP) connected to the machines.

Where do I have to store the login script?
How do I assign it to all users or machines?
How can I check that the script ran?
Will it run every time or once per machine or user?

SORRY AND THANKS, i'm really a newbie

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now