Jump to content

Recommended Posts

Posted

We have a KixStart script which allocates printers based on station name. For the Library we have:

 

CASE LEFT(@WKSTA, 3) = "lib"

AddPrinterConnection ("\\Server\Library")

SetDefaultPrinter ("\\Server\Library")

 

This works very well. However I have a need to allocate the same printer to multiple stations:

 

CASE LEFT(@WKSTA, 5) = "eng01","eng02","eng03"

AddPrinterConnection ("\\Server\English")

SetDefaultPrinter ("\\Server\English")

 

To achieve the same result I currently have to use:

 

CASE LEFT(@WKSTA, 5) = "eng01"

AddPrinterConnection ("\\Server\English")

SetDefaultPrinter ("\\Server\English")

 

CASE LEFT(@WKSTA, 5) = "eng02"

AddPrinterConnection ("\\Server\English")

SetDefaultPrinter ("\\Server\English")

 

CASE LEFT(@WKSTA, 5) = "eng03"

AddPrinterConnection ("\\Server\English")

SetDefaultPrinter ("\\Server\English")

 

I am beginning to think that my KixStart syntax is incorrect. Can anyone suggest what the correct syntax should be?

 

BTW: I know I could use:

 

CASE LEFT(@WKSTA, 3) = "eng"

AddPrinterConnection ("\\Server\Library")

SetDefaultPrinter ("\\Server\Library")

 

but not all of the stations with similar names always get pointed to the same printer (eg: Eng04 may want to use Science and Admin printers for reasons of proximity to the printer)

 

TIA.

Posted

You really want to make sure that the machine names have unique stems which are the same length (whether that's 3 or 5 or whatever characters) and then you can do something like:

$stem=LEFT(@WKSTA, 5)
select
 case $stem="ENG01" or $room="ENG02"
  $printer="\\Server\English"
 case $stem="LIBRA"
  $printer="\\server2\library"
 case $stem="MATH0" or $room="MATH2"
  $printer="\\server\maths"
endselect

AddPrinterConnection ($printer)
SetDefaultPrinter ($printer)

If you can't do that, can you find the OU the machines are in and use that as your identifier to determine the printer?

Posted
You really want to make sure that the machine names have unique stems....

 

Station names are not wholly within my gift [Our network is part of a Consortium and for various reasons I am not able to name stations as I would like at the moment. That will change later. For now I have to suffer the limitations of the current naming scheme]

 

If you can't do that, can you find the OU the machines are in and use that as your identifier to determine the printer?

 

I am using the OU to determine which printers Students get which is not always the printers Staff require in the same rooms: Our MFL department want to print back to their office when they logon but they also want students to print to the classroom based stations. :doh:

 

I will look at your coding suggestion: Perhaps I can adapt my script around the method described by you in your post.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...