Solved

2003 ad netowrk printers

Posted on 2006-10-31
10
318 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
  • 2
  • 2
  • 2
  • +1
10 Comments
 
LVL 8

Accepted Solution

by:
garyrafferty earned 168 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
 

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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 9

Assisted Solution

by:SamuraiCrow
SamuraiCrow earned 166 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 166 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now