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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up a printer for 40 users 2

Status
Not open for further replies.

CRAIG2432

Technical User
Jan 23, 2007
93
GB
I have a single caonir3 networked printer. I need to install it for all 40 users. Do I use GP, I have tryed but I am told to use Printer folder. I have shared the printer and I can manualy navigate to the server and install it that way. I could do this but what happen when you are in an eniroment where there are hunbreds or thousands of users
 
Code:
Option Explicit

On error resume next

Dim WSHShell, WSHNetwork, Path


Set WSHNetwork = CreateObject("WScript.Network")
Set Network = CreateObject("Wscript.Network") 


Network.AddwindowsPrinterConnection "\\servername\printername"
Network.SetDefaultPrinter "\\servername\printername"


set WSHNetwork = Nothing
Set Network = Nothing

  
'Quit the Script
wscript.quit

Just change the \\servername\printername bit and you should be away. Add it as a user logon script in the OU that holds your users.
 
porkchopexpress is right on. Use the 2003 R2 printing if you have it. Pushing out a printer via GPO is much easier than doing it via SneakerNet. Or even vbs. You can also remove printers deployed via R2 as well. Makes for easier management.

Pat Richard, MCSE MCSA:Messaging CNA
Microsoft Exchange MVP
 
Almost right on i messed the script up [blush]

Code:
Option Explicit

On error resume next

Dim WSHNetwork, Path


Set WSHNetwork = CreateObject("WScript.Network")


WSHNetwork.AddwindowsPrinterConnection "\\trigger\b03_4100"
WSHNetwork.SetDefaultPrinter "\\trigger\b03_4100"


set WSHNetwork = Nothing

  
'Quit the Script
wscript.quit
 
Thanks for that. The bad news is its only server 2003 service pack 2 Not R2.
 
The script option looks hard. I have never worked with scripts jet. Can you give me some pointers please.

Thanks
 
Copy the code that i posted above (the second time) into notepad and change the servername\printername part to your server\printername then save it to your PC, name it printers.vbs and run it it should add your printer as the default. Once you have this working you will need to save the script to network share, either the GPO in the sysvol folder of in the NETLOGON folder you will then need to add it as a logon script follow the instructions in the link below.

Introduction to Assigning Logon Script via Group Policy


If you are unsure then create a test OU or try it on a test box first you will soon see that it's quite easy.
 
Thank you very much. You have just saved me hours.
Star given.
 
No problem.

If you get chance take a look at the FAQ it will give you some ideas about what you can do with VB mapping drives etc and most of it is already there in the FAQ.
 
Well now that all that worked VERY WELL. If I wanted to install a second printer using the same method, but not to be the default. Would I just remove the line of text

WSHNetwork.SetDefaultPrinter "\\trigger\b03_4100"

and run it as a second script called printers2.vbs

or can I compine both printers in the same script....
 
Just add another line to the same script.

Code:
Network.AddwindowsPrinterConnection "\\trigger\printer1"
Network.AddwindowsPrinterConnection "\\trigger\printer2"
Network.SetDefaultPrinter "\\trigger\printer1"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top