PDA

View Full Version : installing printers for multiple users



quantrill
01-08-2002, 07:38 PM
Is it possible to install printers for all users on a machine? Im running win2k on a network and I would like to be able to set each machine to print to a network printer. However in order to do that it seems that each person who logs on has to readd the printer. is it possible to add it once and have that printer set for all users that log onto that machine?

hutzmoose
01-09-2002, 03:48 PM
Unfortunately I don't think that is something that is doable, however, you could setup a logon script that maps the network printers everytime a user logs onto the network. There are lots of options when it comes to logon scripts, and we find them invaluable here. If you need more info on them just post and I (as well as others) will respond with our different ways of doing it.

Good Luck

Mike

Fumbling through the registy since 1998 ;o)

quantrill
01-09-2002, 05:36 PM
I was askign around and someone told me that if i went to Properties of the printer and clicked on the Secruity Tab there was a way to set the printer for all users on that machine. Im not seeing that though. is this not true or am i missing it?

hutzmoose
01-09-2002, 06:38 PM
That is the first I have ever heard of it. But that doesn't make it untrue. I have always used a script to set them up.

Mike

Fumbling through the registy since 1998 ;o)

pdukes
01-09-2002, 11:02 PM
I am running w2k pro and i will tell you that yes there is a security tab but i use this machine for a base so it may be different with the network printers

hutzmoose
01-10-2002, 05:43 PM
I too am on a Win2K box, but on an NT network. There is a security tab, but I see nothing that says allow all users to use printers. Not sure how many unique users you have on each machine, but once the printer is added the first time they log on it should always be there.

Mike

Fumbling through the registy since 1998 ;o)

Holty
01-14-2002, 09:54 AM
Can you give me any example scripts of how to add a printer using a logon script???

Plz!!! This would be most hopeful to me!!!

Little_Red_Frog
01-14-2002, 11:36 AM
Hi Holty

this is a example of a kixstart script we use

; NLDMND011PDC - HP_Jet5NCP - Cash Pooling
$ = ExistKey("HKEY_CURRENT_USER\Printers\Connections\,,NLDMND011 PDC,HP_JET5NCP")
If InGroup("PRT-01")
If $ <> 0
$ = ADDPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET5NCP")
EndIf
$Printers = $Printers + CHR(13) + CHR(10) + " \\NLDMND011PDC\HP_JET5NCP"
Else
If $ = 0
$ = DELPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET5NCP")
EndIf
EndIf


; NLDMND011PDC - HP_Jet4000CP Cash Pooling
$ = ExistKey("HKEY_CURRENT_USER\Printers\Connections\,,NLDMND011 PDC,HP_JET4000CP")
If InGroup("PRT-02")
If $ <> 0
$ = ADDPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000CP")
EndIf
$Printers = $Printers + CHR(13) + CHR(10) + " \\NLDMND011PDC\HP_JET4000CP"
Else
If $ = 0
$ = DELPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000CP")
EndIf
EndIf


; NLDMND011PDC - Hp_Jet4000CB Central Billing
$ = ExistKey("HKEY_CURRENT_USER\Printers\Connections\,,NLDMND011 PDC,HP_JET4000CB")
If InGroup("PRT-03")
If $ <> 0
$ = ADDPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000CB")
EndIf
$Printers = $Printers + CHR(13) + CHR(10) + " \\NLDMND011PDC\HP_JET4000CB"
Else
If $ = 0
$ = DELPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000CB")
EndIf
EndIf


; NLDMND011PDC - Hp_Jet4050TS - Transaction Support
$ = ExistKey("HKEY_CURRENT_USER\Printers\Connections\,,NLDMND011 PDC,HP_JET4050TS")
If InGroup("PRT-05")
If $ <> 0
$ = ADDPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4050TS")
EndIf
$Printers = $Printers + CHR(13) + CHR(10) + " \\NLDMND011PDC\HP_JET4050TS"
Else
If $ = 0
$ = DELPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4050TS")
EndIf
EndIf

; NLDMND011PDC - Hp_Jet4000MT - Management Team
$ = ExistKey("HKEY_CURRENT_USER\Printers\Connections\,,NLDMND011 PDC,HP_JET4000MT")
If InGroup("PRT-06")
If $ <> 0
$ = ADDPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000MT")
EndIf
$Printers = $Printers + CHR(13) + CHR(10) + " \\NLDMND011PDC\HP_JET4000MT"
Else
If $ = 0
$ = DELPRINTERCONNECTION ("\\NLDMND011PDC\HP_JET4000MT")
EndIf
EndIf


Good luck

Alex T

hutzmoose
01-14-2002, 02:40 PM
We also use <a target="_blank" href=http://Kixtart.rog> Kixtart </a> but this is what our script looks like. The Add Printer Connection line simply does that. It adds network printer connections. The way we have it set up is as follows. In User Manager for Domains, we call on a logon.bat file, (which launches nav updaters etc), the logon.bat calls on kixtart.exe to run logon.script (below is a copy/paste of logon.script)

; deletes temp files upon logon
del "%TEMP%\*.tmp"

;calls on a bat file to delete the outlook .ost file
run \\server\public\delost.bat

;adds network printers
ADDPRINTERCONNECTION ("\\servername\printername1") &gt; 0

ADDPRINTERCONNECTION ("\\servername\printername2") &gt; 0

ADDPRINTERCONNECTION ("\\servername\printername3") &gt; 0

;maps network shared drives
use s: \\Servername\SharedFolder

use V: \\Servername\SharedFolder2



Mike

Fumbling through the registy since 1998 ;o)

Little_Red_Frog
01-14-2002, 03:03 PM
Hutzmoose,

sorry should have explained, the one i have put up check in which group the print group the user is in

it also checks if the user has the printer al ready installed

many thanks

alex t

Necos
01-16-2002, 08:40 AM
Personally, I couldn't really understand Kixtart syntax, since it was pretty weird. I was looking at this same problem, and found a very interesting solution. I wrote a Perl script (named printers.pl... how original, right? ^_~) that adds printers based on where a user is, as well as setting the default printer. I never thought anyone would find this script useful (except for me). However, if any of you are avid Perl programmers, you might want to look into this script I wrote. The only module it uses is Win32::Registry, which is included in the standard ActivePerl install (I've only tested it with ActivePerl 522, but it should scale up to version 6 and higher).

The idea behind the script is simple (of course finding out all the registry keys to make it happen was a pain in the rump). The script (which can be packaged into an exe wit Perl2exe or PerlApp) checks to see what the computer is named (e.g., 0001-IBM733-351). At my office, we have the computers named with a count number (first 4 digits), a model number (middle portion), and a classroom number (last 3 digits). The middle is unimportant, only the first and last portions are of care (of course, it's fairly easy to change the code to accomodate different computer naming schemes). The script checks to see what the computer name is, and strips out the first and last digits. There is a configuration file that looks something like this:

0001,0010,276,\\Server\Printer
0011,0040,276,\\Server\Printer2
...
...

The script looks at the last part of the computer name (which is a room number) and compares it to the 3rd item in the configuration file (which can have any number of lines). If the room number matches, the printer will be installed. If not, the printer will not be installed. After compiling a list of printers that need to be installed (as well as checking against which printers are already installed), the script goes through each printer and installs it (if it is not already installed) using just registry writes.

After all the printers that need to be installed are installed, the script looks at the config file again, but this time, at the first two numbers (which are ranges). If the first part of the computer name falls in between the integer range in the config file, it will have that printer set to be it's default.

Some people call it a bit of an overkill, but it has become quite useful at the high school I work at (since we have about 1,000 machines). The only caveat I know of (but I have not tested), is that the printer drivers have to be installed before this script run. Of course, since I personally pre-load software on the boxes before they hit the classroom, it's just one more step for me.

If anyone's interested in obtaining the source code for this script, let me know. My email address is secon_kun@hotmail.com. I just thought I'd mention this script since I found it fairly useful (of course, it better be useful for me since I spent about a month writing it.).

Necos