Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add printer scrupt.

Status
Not open for further replies.

ozmoeugene

IS-IT--Management
May 6, 2004
20
US
I would like to add a script to the windows server 2003 environment. This script would load a printer for a user based on the group.

Where would I put this script;
1. In the startup for this group on the server?
2. In the startup for the group on each client machine?


If that is not correct above, please let me know where.

If you have a sample script that adds a printer, perferrably in Visual Basic, Please post it so that I can see an idea of a working script.

All Ideas accepted.

Thanks ahead of time.

OZMOEUGENE
 
You would put it in neither of those locations, you would put it in a logon script. Heres a sample of a script its pretty basic and you can add multiple printers.

If you break the users setup into different OU or you could use some sort of IF command along with this script.

Take a look at MS script site or google search if you want to find more scripts.

' VBScript Source File
'
' NAME: mapprinters.vbs
'
' COMMENT: Maps network printers
'

Option Explicit

Dim x
Dim wshNetwork
Dim printer(1)

printer(0) = "\\server\printer"
printer(1) = "\\server\printer"
'printer(2) = "\\server\printer"
'printer(3) = "\\server\printer"
'printer(4) = "\\server\printer"

On Error Resume Next

Set wshNetwork = WScript.CreateObject("WScript.Network")

' Add printers
For x = 0 To 1
wshNetwork.AddWindowsPrinterConnection printer(x)
Next


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top