?
Solved

2003 ad netowrk printers

Posted on 2006-10-31
10
Medium Priority
?
359 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

 [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

Question has a verified solution.

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

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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