• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

2003 ad netowrk printers

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
zenworksb
Asked:
zenworksb
  • 2
  • 2
  • 2
  • +1
3 Solutions
 
garyraffertyCommented:
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
 
zenworksbAuthor Commented:
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
 
garyraffertyCommented:
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
zenworksbAuthor Commented:
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
 
SamuraiCrowCommented:
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
 
SamuraiCrowCommented:
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
 
LazarusCommented:
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
 
LazarusCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now