Page 1 of 2 12>
Topic Options
#62855 - 2002-02-06 02:31 PM PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


i NEED TO EDIT MY SCRIPTS TO DEFINE WHICH WORKSTATION AND WHIICH PRINTER TO USE FOR EXAMPLE IF I WAS WORKING ON A WORKSTATION CALLED T81 I WANT TO PRINT TO LPT1 AND LPT2 WHICH IS POINTING TO CURRICULUM\LAZERT8
CAN ANYONE HELP

PLEASE
SUZANNE.POTS@GLEED.LINCS.SCH.UK

Top
#62856 - 2002-02-06 02:47 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Whoa!
Do you think you could edit your post and lose the upper case? - It's like shouting.

There are many ways of doing this and the complexity of the solution will depend on your setup.

1) What is the logic behind the workstation and printer names?
2) Do different locations have different IP address ranges?
3) What operating systems are your clients using?
4) How many clients / printers are you talking about?

You might also want to try a search of the scripts and starters foums, which will give you more answers than you can shake a stick at.

I'm off to get some aspirin now.

Top
#62857 - 2002-02-06 03:21 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


Ok,
NT worksations version 4
Roaming profiles and group policies
1000 clients
Two networked printes in each IT room
I have edited the script so that if the user is sendind a print and the printer port is set to lpt 1 or lpt 2 in my case both, the print will be sent through the server and back to the network printer, this que's the print jobs and give acces to all users that are in the student group. The problem is that any student that logs on to a workstation that has a local printer pointing to lpt1 or lpt2 all their print jobs come out at the printers in the IT room. So by listing the pc's names and thelling the script where to send the print job this will stop this happening.
Here is my script

if ingroup ("students") =1
gosub students
endif

if ingroup ("cohort99_00") =1
gosub 99
endif

if ingroup ("cohort97_98") =1
gosub 97
endif

if ingroup ("cohort98_99") =1
gosub 98
endif

if ingroup ("cohort00") =1
gosub intake_00
endif

if ingroup ("cohort01") =1
gosub intake_01
endif

if ingroup ("school staff") =1
gosub staff
endif

if ingroup ("domain admins") =1
gosub other
endif

if ingroup ("sims") =1
gosub sims
endif

if ingroup ("Food") =1
gosub food
endif

if ingroup ("PrimarySchool") =1
gosub primary
endif
exit

:intake_01
use u: /del
use u: "\\Utility-server\01"
return

:intake_00
use u: /del
use u: "\\Utility-server\00"
return

:99
use u: /del
use u: "\\Utility-server\99"
return

:98
use u: /del
use u: "\\Utility-server\98"
return

:97
use u: /del
use u: "\\Utility-server\97"
return

:sims
use s: "\\admin-server\applicat"
return

:students
use g: /del
use r: /del
use o: /del
use t: /del
use s: /del
use k: /del
use m: /del
use r: "\\Utility-server\roa$"
use o: "\\Utility-server\shared"
use s: "\\Utility-server\careerscape"
use k: "\\Utility-server\kudos"
use m: "\\Utility-server\omnigraph"
use i: "\\cdromserver\sschool"
use g: "\\Utility-server\itskills"
use l: "\\curriculum\rivers"
use lpt1: "\\curriculum\PagePro4100"
use lpt2: "\\curriculum\T8Colour"
use lpt3: "\\library1\hp deskjet 500"
return

:staff
use m: /del
use n: /del
use r: /del
use k: "\\Utility-server\kudos"
use l: "\\Utility-server\careerscape"
use o: /del
use r: "\\admin-server\reports"
use o: "\\Utility-server\shared"
use n: "\\admin-server\y92001"
use m: "\\admin-server\y72001"
use l: "\\curriculum\rivers"
return

:food
use p: /del
use p: "\\cdromserver\the can"
return

ther
;;run "\\Utility-server\shared\ranger\setup.exe"
use r: "\\admin-server\reports"
use z: "\\backup server\cdrom"
use i: "\\cdromserver\sschool"
use t: "\\cdromserver\quickcad"
use p: "\\cdromserver\office97"
return

rimary
use o: "\\Utility-server\shared"
return

Top
#62858 - 2002-02-06 03:43 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The reason I asked the logic behind workstation and printer names is that if you have a decent schema the job becomes far simpler.

If your workstation name comprises a letter identifying it as a workstaion, followed by a three letter site mnemonic followed by a room number followed by a wokstation number the job is almost done for you.

For example, NWGTC20103
Means:
NW NT Workstaion
GTC Gleed Technical College
201 Room 201
03 workstation number three

If you've used a similar scheme for your printers: PRGTC20101
PR Printer
GTC Gleed Technical College
201 Room 201
01 First printer

As you can surmise, all you need to do is substring out the location and room number from the workstation, prepend "PR" then append "01" and "02" to get the names of the printer queues.

Top
#62859 - 2002-02-06 04:01 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


You've lost me
I can understand the breakdown but what would I need to put in exactly.
Cause I havent got a clue about tags or anything script related.
help!!!!!!!!!!
You can see what I have done below Lpt1'''''''''''''''etc
so can you tell me the tag I need?

please

if ingroup ("students") =1
gosub students
endif

if ingroup ("cohort99_00") =1
gosub 99
endif

if ingroup ("cohort97_98") =1
gosub 97
endif

if ingroup ("cohort98_99") =1
gosub 98
endif

if ingroup ("cohort00") =1
gosub intake_00
endif

if ingroup ("cohort01") =1
gosub intake_01
endif

if ingroup ("school staff") =1
gosub staff
endif

if ingroup ("domain admins") =1
gosub other
endif

if ingroup ("sims") =1
gosub sims
endif

if ingroup ("Food") =1
gosub food
endif

if ingroup ("PrimarySchool") =1
gosub primary
endif
exit

:intake_01
use u: /del
use u: "\\Utility-server\01"
return

:intake_00
use u: /del
use u: "\\Utility-server\00"
return

:99
use u: /del
use u: "\\Utility-server\99"
return

:98
use u: /del
use u: "\\Utility-server\98"
return

:97
use u: /del
use u: "\\Utility-server\97"
return

:sims
use s: "\\admin-server\applicat"
return

:students
use g: /del
use r: /del
use o: /del
use t: /del
use s: /del
use k: /del
use m: /del
use r: "\\Utility-server\roa$"
use o: "\\Utility-server\shared"
use s: "\\Utility-server\careerscape"
use k: "\\Utility-server\kudos"
use m: "\\Utility-server\omnigraph"
use i: "\\cdromserver\sschool"
use g: "\\Utility-server\itskills"
use l: "\\curriculum\rivers"
use lpt1: "\\curriculum\PagePro4100"
use lpt2: "\\curriculum\T8Colour"
use lpt3: "\\library1\hp deskjet 500"
return

:staff
use m: /del
use n: /del
use r: /del
use k: "\\Utility-server\kudos"
use l: "\\Utility-server\careerscape"
use o: /del
use r: "\\admin-server\reports"
use o: "\\Utility-server\shared"
use n: "\\admin-server\y92001"
use m: "\\admin-server\y72001"
use l: "\\curriculum\rivers"
return

:food
use p: /del
use p: "\\cdromserver\the can"
return

ther
;;run "\\Utility-server\shared\ranger\setup.exe"
use r: "\\admin-server\reports"
use z: "\\backup server\cdrom"
use i: "\\cdromserver\sschool"
use t: "\\cdromserver\quickcad"
use p: "\\cdromserver\office97"
return

rimary
use o: "\\Utility-server\shared"
return

Top
#62860 - 2002-02-06 04:07 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Ok, one step at a time.

What names do your workstations have?

Top
#62861 - 2002-02-06 04:22 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


Thank so much you dont know what a releif it is to have some help! I've been here 4 weeks and its mad!!!

Ok the pc's are named T81 to T820
and T91 to T920
we have rooms number T something so if we start with
T81
T82
T83
T84
T85
T86
T87
T88
T89
T810
ect
and the printers are
use lpt1: "\\curriculum\PagePro4100"
use lpt2: "\\curriculum\T8Colour"
if you can show me how to set up this room I might be able to duplicate around the rest of the rooms!!!!!!!!!
Thanks

Top
#62862 - 2002-02-06 04:58 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
This should give you an idea how to get on:
code:

$sRoom=substr(@WKSTA,1,2) ; Room Prefix Tx
$iPCNo=substr(@WKSTA,3,9) ; Simple sequential PC number.

"This is PC number " $iPCNo " in room number " $sRoom ?

Select
Case $sRoom = "T8"
Use lpt1: "\\curriculum\T8Colour"
Case $sRoom = "T9"
Use lpt1: "\\curriculum\PagePro4100"
Case 1
"No printer mapped - room not recognised" ?
EndSelect


The scriptlet substrings off the first two characters and uses that in the "Case" construct to decide what to map. I also substring off the number, but don't actually use it.

Just as an aside, using this naming scheme would T123 be workstation 23 in room 1, or workstation 3 in room 12? Or do you only have 9 rooms?

Top
#62863 - 2002-02-06 05:27 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


T1
T2
T3
T4
T5
T6
T7
T8
T9
THEN
S1
S2
S3
S4
S5
THEN
E1
E2
E3
E4
E5
M1
M2
M3
THEN
EVERY ROOM HAVE A LETTER AND A NUMBER
THEIR IS ABOUT 35 CLASSROOMS
T123 = ROOM T1 WORKSTATION 23

Top
#62864 - 2002-02-06 06:02 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Ok.

Just use the scriptlet I posted previously as a skeleton, and add all the "Case" sections you need.

Top
#62865 - 2002-02-06 06:09 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


THANKS
Which bits do I edit

sRoom=substr(@WKSTA,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21) ; Room Prefix T8$iPCNo=substr(@WKSTA,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21) ; Simple sequential PC number."This is PC number " $iPCNo " in room number " $sRoom ?SelectCase $sRoom = "T8" Use lpt1: "\\curriculum\T8Colour"Case $sRoom = "T9" Use lpt1: "\\curriculum\PagePro4100"Case 1 "No printer mapped - room not recognised" ?EndSelect

is this what you mean?
Can i add the other rooms in the same way?

Top
#62866 - 2002-02-06 06:31 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Eek! No!

I'm going out on a limb here, but I gues you don't have much experience of KiXtart, eh?

Ok. I'll break the script down and explain it bit-by-bit.

code:
$sRoom=substr(@WKSTA,1,2)   ; Room Prefix


@WKSTA is a macro that contains your workstation name. Everything after the semi-colon ";" is a comment.
The substr function starts at character 1 and takes the next two characters, and assigns this to the variable $sRoom. If your workstation name is "S25" the $sRoom variable now contains "S2".

code:
$iPCNo=substr(@WKSTA,3,9)   ; Simple sequential PC number.


This line is very similar to the last. It takes up to 9 characters from @WKSTA starting at position 3 and assigns them to the variable $iPCNo. Using the same example, if your workstations is called "S25", $iPCNo now contains "5". We are not actually going to use it here.


code:
"This is PC number " $iPCNo " in room number " $sRoom ?


This line is purely debugging, to let you know what is going on. It will display the room number and PC number that we have just extracted from @WKSTA

code:
Select


The "Select" statement started the "Select/Case/EndSelect" construct. The "Select" construct is like a multi-line if, where only one of the conditional tests is true.

code:
Case $sRoom = "T8"


This is the first test in the "Select" construct, and it checks if the room number that we extracted, i.e. the first two digits of the workstation name is "T8". If it is, the following statements are executed.


code:
	Use lpt1: "\\curriculum\T8Colour"


This is the statement that is executed if $iRoomNo is "T8". You can have more than one statement - I've only included one to keep it short.


code:
Case $sRoom = "T9"
Use lpt1: "\\curriculum\PagePro4100"


I've left both parts of the "Case construct here. The "Use" will only be executed if $sRoom is "T9".

code:
Case 1
"No printer mapped - room not recognised" ?


The "Case 1" is a special case. It is always executed if none of the previous cases were true. This case is used as an exception or default behaviour. In this instance we simply output an error message.

code:
EndSelect


The "EndSelect" ends the "Select" construct.

To extend this for your other rooms you simply need to insert more "Case" and "Use" statements, so

code:
Case $sRoom = "S1"
Use LPT1: \\server\first-printer-for-s1
Use LPT2: \\server\second-printer-for-s1
Case $sRoom = "E4"
Use LPT1: \\server\first-printer-for-E4
Use LPT2: \\server\second-printer-for-E4
Use LPT3: \\server\third-printer-for-E4

And so-on.

Top
#62867 - 2002-02-06 06:32 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


going home but I'll pick it up in the morning
Thanks
Suzanne

Top
#62868 - 2002-02-07 08:21 AM Re: PRINTER DEFINITION BY WORKSTATION
sue potts Offline
Fresh Scripter

Registered: 2002-02-07
Posts: 7
Hi I'm at home now its 6.00 morning cant sleep!
Thanks so much
One more question does it matter where I put the script in my exsisting script, as you can see their are groups students, teacher food etc will this give print rights to all users?
Yep you were right I have never used Kixtart I havent got a clue.
Here's my script I have tryed to add your bit could you check it please?
if ingroup ("students") =1
gosub students
endif

if ingroup ("cohort99_00") =1
gosub 99
endif

if ingroup ("cohort97_98") =1
gosub 97
endif

if ingroup ("cohort98_99") =1
gosub 98
endif

if ingroup ("cohort00") =1
gosub intake_00
endif

if ingroup ("cohort01") =1
gosub intake_01
endif

if ingroup ("school staff") =1
gosub staff
endif

if ingroup ("domain admins") =1
gosub other
endif

if ingroup ("sims") =1
gosub sims
endif

if ingroup ("Food") =1
gosub food
endif

if ingroup ("PrimarySchool") =1
gosub primary
endif
exit

:intake_01
use u: /del
use u: "\\Utility-server\01"
return

:intake_00
use u: /del
use u: "\\Utility-server\00"
return

:99
use u: /del
use u: "\\Utility-server\99"
return

:98
use u: /del
use u: "\\Utility-server\98"
return

:97
use u: /del
use u: "\\Utility-server\97"
return

:sims
use s: "\\admin-server\applicat"
return

:students
use g: /del
use r: /del
use o: /del
use t: /del
use s: /del
use k: /del
use m: /del
use r: "\\Utility-server\roa$"
use o: "\\Utility-server\shared"
use s: "\\Utility-server\careerscape"
use k: "\\Utility-server\kudos"
use m: "\\Utility-server\omnigraph"
use i: "\\cdromserver\sschool"
use g: "\\Utility-server\itskills"
use l: "\\curriculum\rivers"

$sRoom=substr(@WKSTA,1,2) ; Room Prefix Tx
$iPCNo=substr(@WKSTA,3,9) ; Simple sequential PC number.
"This is PC number " $iPCNo " in room number " $sRoom ?
Select
Case $sRoom = "T8"
Use lpt1: "\\curriculum\T8Colour"
Use lpt2: "\\curriculum\Pagepro4100"
Case $sRoom = "T9"
Use lpt1: "\\curriculum\T9colour"
Use lpt2: "\\curriculum\T9black"
Case $sRoom = "T7"
Use lpt1: "\\curriculum\T7Colour"
Use lpt2: "\\curriculum\T7black"

Case 1 "No printer mapped - room not recognised"
?EndSelect
return

:staff
use m: /del
use n: /del
use r: /del
use k: "\\Utility-server\kudos"
use l: "\\Utility-server\careerscape"
use o: /del
use r: "\\admin-server\reports"
use o: "\\Utility-server\shared"
use n: "\\admin-server\y92001"
use m: "\\admin-server\y72001"
use l: "\\curriculum\rivers"
return

:food
use p: /del
use p: "\\cdromserver\the can"
return

ther
;;run "\\Utility-server\shared\ranger\setup.exe"
use r: "\\admin-server\reports"
use z: "\\backup server\cdrom"
use i: "\\cdromserver\sschool"
use t: "\\cdromserver\quickcad"
use p: "\\cdromserver\office97"
return

rimary
use o: "\\Utility-server\shared"
return

..............................
TIA
I have made a new log on if you were wondering the one I used yesterday was the old network managers Brian, My name is suzanne.

Top
#62869 - 2002-02-07 10:33 AM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Hi Suzanne,

Good grief girl, it is still too cold and dark to be up and about at 06:00.

The scriplet is fine where you've inserted it, but because it is in the subroutine called for "students" it will only apply to these logins.

If you'd rather control the printer mapping of everyone regardless of which groups they belong to simply stick the scriplet at the beginning of your script.

For instance you are not mapping printers for the members of the staff group - that may be your intention which is fine.

I also notice that there are some oddities in the script which may have been cause by cutting and pasting. You are missing the ":O" from the ":Other" label and ":P" from the ":Primary" label at the bottom of your script. Also, ensure that there is a space between "?" and "EndSelect", or place them on seperate lines.

As an aside, if all your rooms' printers were named "{RoomName}Colour" and "{RoomName}"Black the script would have been really simple:

code:
$sRoom=substr(@WKSTA,1,2)   ; Room Prefix Tx
Use lpt1: "\\curriculum\" + $iRoomNo + "Colour" ; Map rooms colour printer to LPT1
Use lpt2: "\\curriculum\" + $iRoomNo + "Black" ; Map rooms b&w printer to LPT2

[ 07 February 2002: Message edited by: Richard Howarth ]

Top
#62870 - 2002-02-07 11:51 AM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


Thanks Richard,
I'll try that later when no one's using,
One thing will it mater if the pc's are namedT8_1 will the underscore affect the script or should I rename all the pcs and take out the underscore?

Top
#62871 - 2002-02-08 12:03 AM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Sounds like you have enough on your plate at the moment.

There is no need to rename the workstations now as only the first two characters are uses.

When you have breathing space it may well help you to review the names used for the workstations and printer shares and get them in a common format.

Top
#62872 - 2002-02-07 01:18 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


Thanks Richard


If I just add T8 code for now will the rest of the printers in the school come up with no printers mapped?or will they continue un affected sending to their normal location?

Top
#62873 - 2002-02-07 02:41 PM Re: PRINTER DEFINITION BY WORKSTATION
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Only the T8x machines will get their printers mapped.

The rest of the school will continue to get their existing mappings which have presumably been added to each machine at some time in the past.

Top
#62874 - 2002-02-07 04:05 PM Re: PRINTER DEFINITION BY WORKSTATION
Anonymous
Unregistered


Hi Richard
The other printers in the school are not connected the same way.
The other printers in the school are connected to print servers from each workstation and not configured in the log on scripts at all.
Some have local printers pointing to Lpt1
Im just a bit worried in case I disconnect all the printers.

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 895 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.113 seconds in which 0.066 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org