Tech Support > Microsoft Windows > Windows Server > Logon Script for adding printers to clients
Logon Script for adding printers to clients
Posted by Gareth on April 29th, 2005


Hello,

We have about 200 users and need them to be connected to some new printers
in the office. To same me some time i decided that it would be advantagous
to role these out using a batch file logon script. Does anyone out there
know of a script that i can use??

The print server i use is a W2K3 server and clients are Win2K / XP

Any help, is appriciated

Regards,

Gareth

Posted by Kevin Longley on April 29th, 2005


You can use 2 resource kit utilities to assign printers based on group
membership. Works very well if your users work primarily from the same
computer all the time. This is not a good solution for roaming users. The
utilities are ifmember and con2prt. You should be able to find some info on
these utilities within the resource kit. Below is a sample batch file that
can be called from a login script.

REM=============================================== ==
REM Windows 2000/XP Professional Printer Assignment script
REM=============================================== ==


REM=============================================== ==
REM Test group membership (group is the pre windows 2000 name)
REM=============================================== ==

ifmember "Printer1"
if errorlevel 1 goto :Printer1

ifmember "Printer2"
if errorlevel 1 goto :Printer2

goto :END


REM=============================================== ==
REM Assign printers based on group membership
REM=============================================== ==

:Printer1
con2prt /cd \\comp1\HR_22KCL
NET USE LPT1: \\comp1\HR_22KCL /PERSISTENT:NO
goto :END


:Printer2
ifmember "Domain Admins"
if errorlevel 1 goto :Printer2S
con2prt /f
:Printer2S
con2prt /c \\comp2\HPDesign800PS
con2prt /cd \\comp2\02_clr1
goto :END

:END

"Gareth" <Gareth@discussions.microsoft.com> wrote in message
news:0E9609A0-BC38-4943-9112-9A8D4B0948B5@microsoft.com...


Posted by Michel Boks on April 29th, 2005


Gareth,

You could use KIX32. The script would then look like this:

;*************************
IF INGROUP ("Printer_ADGroup")
AddPrinterConnection ("\\SERVER\Printername")
ENDIF
;*************************

Regards,
--

Michel Boks - B.ICT
MCSE NT4/2000


"Gareth" wrote:

Posted by Kevin Longley on April 29th, 2005


Can kix32 evaluate groups that contain computers as members?
"Michel Boks" <MichelBoks@discussions.microsoft.com> wrote in message
news:60843C31-6963-4419-93B3-388E445E4DFE@microsoft.com...



Similar Posts