Discussion Locked

Install printers via logon scripts!

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

Does anyone have an example of a logon script I can use in my Windows 2000/2003 active directory that will install network printers automatically?

Giacomo

4 replies

by johnscorp

'
' SimplePrintersNorth.vbs
' VBScript to connect network printers located in North Building
' Version 1.0 - NOVEMBER 19 2007
'
Option Explicit

Dim objNetwork

'Declare old printers
Dim strUNColdPrinter1 'North RICOH 3235C PS on hfm-srv01
Dim strUNColdPrinter2 'North RICOH 3235C PCL6 on hfm-srv01

'Declare new printers
Dim strUNCPrinter1 'North RICOH 3235C PS on hfm-srv04
Dim strUNCPrinter2 'North RICOH 3235C PCL6 on hfm-srv04

'Define old printers
strUNColdPrinter1 = "\\hfm-srv01.hoffmann.local\North RICOH 3235C PS"
strUNColdPrinter2 = "\\hfm-srv01.hoffmann.local\North RICOH 3235C PCL6"

'Define new printers
strUNCPrinter1 = "\\hfm-srv04.hoffmann.local\North RICOH 3235C PS"
strUNCPrinter2 = "\\hfm-srv04.hoffmann.local\North RICOH 3235C PCL6"

'Should be obvious
On Error Resume Next

'Create Objects
Set objNetwork = CreateObject("WScript.Network")

'Remove old printers
objNetwork.RemovePrinterConnection strUNColdPrinter1
objNetwork.RemovePrinterConnection strUNColdPrinter2

'Add new printers
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
objNetwork.AddWindowsPrinterConnection strUNCPrinter2
WScript.Quit

' End of script.

This discussion is closed to new replies.