?
Solved

2003 ad netowrk printers

Posted on 2006-10-31
10
Medium Priority
?
364 Views
Last Modified: 2010-04-18
Hello I have a server at a new client that has all the printers setup on it. when  a new usert starts I have to transvers the network  and isntall the shared printer. the owner has come to me and wants every printer in the place to be automatically installed to every user new user etc. there are about 15 printers, how woudl I accomplisdh this
0
Comment
Question by:zenworksb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
10 Comments
 
LVL 8

Accepted Solution

by:
garyrafferty earned 672 total points
ID: 17844461
Create a VB script and run the script when the users logon the script will connect to the server and install the printers on the client.

Use the following lines to connect the printers

Set WshNetwork = CreateObject("WScript.Network")

WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer1"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Printer1"
0
 

Author Comment

by:zenworksb
ID: 17844490
so if I have say 5 printers. i create the script like this

Set WshNetwork = CreateObject("WScript.Network")

WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer1"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Printer1"

WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer2"
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer3"
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer4"
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Printer5"

where do i put this in the default logon script. can you give me steps where to do this and how? also what if I add the script in the logon script, and they already have the printer what happens then? thank you so much
0
 
LVL 8

Expert Comment

by:garyrafferty
ID: 17844574
You dont have to set the default printer, if there is an existing connection to the printer it will create another one (i think you will need to test it)

You can call the vb script from the logon script by adding a line like

wscript \\server\share\printers.vbs

 
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:zenworksb
ID: 17844820
ok so i add the wscript \\server\share\printers.vbs to the global login script

how do I create the vb script? and where do I place it

if they already have the printer and then it tries to give it to them through the login script will it give it to them again?

thank you so much this will be really cool
0
 
LVL 9

Assisted Solution

by:SamuraiCrow
SamuraiCrow earned 664 total points
ID: 17845434
Create conditional processing in the logon script.  This will check for the existance of a text file with the user and computer name in the title.  The file gets created after the first time the printers are installed.  You can also use prnmngr.vbs to add printers on windows xp clients (it's built in):

if exists \\servername\sharename\username-computername.txt goto EndPrint

:StartPrint

prnmngr -ac -p "\\server\printer1"
prnmngr -ac -p "\\server\printer2"
prnmngr -ac -p "\\server\printer3"
prnmngr -ac -p "\\server\printer....."

echo %username,%computername% > \\servername\sharename\%username%-%computername%.txt

:EndPrint

:StartDriveMapping

net use x: \\servername\sharena.....
0
 
LVL 9

Expert Comment

by:SamuraiCrow
ID: 17845449
One change:

This line:

if exists \\servername\sharename\username-computername.txt goto EndPrint

Should be:

if exists \\servername\sharename\%username%-%computername%.txt goto EndPrint
0
 
LVL 20

Assisted Solution

by:Lazarus
Lazarus earned 664 total points
ID: 17846363
Below is a Login script tha tyou can use in your User profiles. you can remove the Deletes Printers section if you don't need it, or just place a " ' " in fron of the lines you don't use.


'**************************************************
Set objNetwork = CreateObject("WScript.Network")
' Forces script to skip errors (rem below line to see errors)
on error resume next

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")

'deletes mapped drive
WshNetwork.RemoveNetworkDrive "Z:"
'adds mapped drive
WshNetwork.MapNetworkDrive "Z:", "\\SERVERNAME\SHAREDFOLDER"

' deletes all network printers
Set clPrinters = WshNetwork.EnumPrinterConnections
On Error Resume Next
For i = 0 to clPrinters.Count - 1 Step 2
wshNetwork.RemovePrinterConnection clPrinters.Item(i+1), true
Next

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\SERVERNAME\FD_HP1320n"
PrinterDriver = "hp LaserJet 1320 PCL 6"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\SERVERNAME\FD_HP1320n"

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\SERVERNAME\HP1300n"
PrinterDriver = "hp LaserJet 1320 PCL 6"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
'WshNetwork.SetDefaultPrinter "\\SERVERNAME\HP1300n"

WSCript.Quit
'*************************************************
0
 
LVL 20

Expert Comment

by:Lazarus
ID: 17846373
I forgot to explain that the line:

PrinterDriver = "hp LaserJet 1320 PCL 6"

is to tell the client computer where and what driver to get for that printer.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question