How to: Add a network printer with a script

Enviado por elio el 2005, Julio 29 - 3:50pm.
Grupos: Toolbox

Step 1: Open Notepad.

Step 2: Paste the following block of text into Notepad and replace the values with the information for your printers. If you don't wish to set a default printer, remove that line.

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server\printer1"
WshNetwork.AddWindowsPrinterConnection "\\server\printer2"
WshNetwork.SetDefaultPrinter "\\server\printer1"

Step 3: Save your new VBScript as "addprinters.vbs".

Step 4: Use Group Policy to add this script as a logon script for the OU you want to assign the printers to.

Step 5: Log off the computers in that OU manually, remotely using psshutdown.exe, via another script, or ask users to log out when they leave for the day. When they log back in next morning the printers will be added.

its really good....but

Enviado por smehmood el 2007, Septiembre 28 - 2:54am.

thanx for the code and it worked pefectly fine... but if i login to any server it adds the printers on the server as well...which we dont want... any solution??? Thanks. Syed

Toolbox

Techonology tools and resources

Toolbox

  • Debe loguearse o registrarse para contribuir a este grupo.

Navegación

Inicio de sesión de usuario