Solved

2003 ad netowrk printers

Posted on 2006-10-31
10
327 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
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

21 Experts available now in Live!

Get 1:1 Help Now