Page 3 of 3 <123
Topic Options
#105722 - 2003-10-13 09:25 PM Re: Primary computer group membership
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
quote:
UnmapPrinters() - Removes mapped printers not listed in an .INI file
That should be a no-brainer as every user can have only one default printer. It is thus up to you to define the reules/requirements that determine the user's default printer.
quote:
if using an ini file for each computer, have the ini file duplicate the printer setup in the file on the computer (not user based). If printer not in INI file, delete. If in file, but not on pc, install.

Per-user printer assignments are easier.

Also, don't make things more complicated than they are. You might want to take a step back and think really hard about the printer assignment requirements on paper. Why does a user need a particular printer? Why is it the default printer? How is this decided? What is the pattern? How can I group users into groups for particular printers.

It is very hard to help you if you don't even explain the requirements properly.
_________________________
There are two types of vessels, submarines and targets.

Top
#105723 - 2003-10-13 09:51 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Thanks, sealeopard.

To help understand a little, I work at a rehab hospital and the staff move around -- different treatment rooms, different floors, patient rooms, nursing stations, even remote sites. They always want to print to the closest printer but don't usually know the printer name. They also don't know how to change the default printer (yes, it is easy, but they refuse to do this). They simply click on the printer icon which prints to the default printer. They not only click, but will click 20 times as if that will fix things. Meanwhile, confidential patient information prints off in area accessible to the public.

And one user may need a color laser printer for some special printout from a medical imaging device, while others want a quick black and white printout. It is determined by the role of the user usually.

I really wish there was only one printer for a computer and my problems would be solved.

Deleting the printer if not in the ini file isn't a requirement, just a wish. The Help Desk could always visit computers to do any kind of cleanup needed. The majority of the issue lies in that the users use shared signons and we are eliminating these with much resistance. Now the users that have gone along with this are upset because they have no installed printers.

I had a script working that mapped printers based on group membership (it did not delete either). It was pointed out that this wasn't the best way to do this.

I am simply trying to make it work for my environment and thought some of the kixtart geniuses that hang out here would have a quick solution for me. I will implement one of the two methods I have working for me now as I need a fairly quick solution. I'll try to work on a better method when I have time.

As usually happens, there are a few other fires I need to put out. Users and their printers will have to wait a little bit.

Thanks for your assistance and in trying to help me re-think the issue.

Top
#105724 - 2003-10-13 09:58 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Here is the script that works based upon group membership:

Group Names based upon - default or additional printer + server + share

DefPrinter_MRH-01_Q-MIS2
AddlPrinter_MRH-01_Q-MIS1

code:
;http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=007920

call @ScriptDir+'\PriMapState.udf'
call @Scriptdir+'\MapPrinter.udf'

;********** Prevent script from running on a server or Win95*********
if @userid = administrator
call @Scriptdir+'\osid.udf'
$os=osid()
if $os[1]='Win95' or $os[2]<>'Workstation'
exit 0
endif
endif

;********** Prevent script from running on Medrec pcs *********
if InGroup ("Medrec Group")
exit 0
endif

;********** Beginning of printer mapping *********

$WS = GetObject("WinNT://" + @domain + "/" + @wksta + "$$")
if @error
? @serror
else
for each $grp In $WS.Groups
$GrpName = $grp.Name

;--- Add and set default printer ---

if left($GrpName,11) = "DefPrinter_"
$defprinter = substr($GrpName,12)
$defprinter = join(split($defprinter,"_"),"\")
Mapprinter("\\" + $defprinter,1)

if not PriMapState("\\" + $defprinter)
? "Status - Printer not connected \\"+$defprinter
$S=AddPrinterConnection("\\" + $defprinter)
? "Status - Printer added \\"+ $defprinter
? @serror
?
$S=SetDefaultPrinter ("\\" + $defprinter)
? "Status - Default Printer set \\" +$defprinter
? @serror
endif

if PriMapState("\\" + $defprinter)<>2
$S=SetDefaultPrinter ("\\" + $defprinter)
? "Status - Default Printer set \\" + $defprinter
? @serror
?
endif

endif


;--- Add additional printers ---

if left($GrpName,12) = "AddlPrinter_"
$addlprinter = substr($GrpName,13)
$addlprinter = join(split($addlprinter,"_"),"\")

if not PriMapState("\\" + $addlprinter)
? "Status - Printer not connected \\" + $addlprinter
$S=AddPrinterConnection("\\" + $addlprinter)
? "Status - Printer added \\" + $addlprinter
? @serror
?
endif

endif

next

endif



[ 13. October 2003, 22:10: Message edited by: tjcarst ]

Top
#105725 - 2003-10-13 10:08 PM Re: Primary computer group membership
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Okay, so the default printer is more or less decided based on the physical location of the computer being used and secondary based on the user role?

Then, for each printer, define the computers that print to it and the user roles that print to it. Decide whether computer overrides user or vice versa. I am assuming you have less printers than computers? You might even group multiple computers into groups of computers, e.g. in AD if you use it or via separate sections of the .INI file. The same applied to the users, try to group them into functional roles via group membership. The following .INI file will work with both AD and NT4 domains, however, the NT4 domain will require the computer-group assignments.
code:
[ComputerOU]
Radiology=Comp1,Comp2,Comp3
Floor1=Comp4,Comp5
Treatment1=Comp6
[\\server\printer1]
Location=Radiology
Groups=RadiologyNurses, XRayNurses
[\\server\printer2]
Location=Treatment1
Groups=Exam1, Exam2

_________________________
There are two types of vessels, submarines and targets.

Top
#105726 - 2003-10-13 10:13 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
The printers are decided mainly by the computer. I am not going to worry about the users for now. The users that require a special printer can learn how to select a different printer. The next user that logs on will get the default printer checked and set.
Top
#105727 - 2003-10-13 10:16 PM Re: Primary computer group membership
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could also spice it up and create a KiXforms (see http://www.kixforms.org ) dialog based on computer and user that is logging in where they have to chose the printer they want to use. That printer will then be the default printer.
_________________________
There are two types of vessels, submarines and targets.

Top
#105728 - 2003-10-13 10:16 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
I need to use variables. Manually creating the ini file with each computer is a big undertaking.

550 computers, 100+ printers.

That was why the two scripts I gleaned from others seemed like such a nice solution. I think I am going to have to settle on just accepting them with their shortcomings.

The ability to just duplicate the INI file each time a user logged on, adding and deleting based upon the contents of the INI file seemed like a good idea. Making it work is proving difficult.

Top
#105729 - 2003-10-13 10:21 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Prompting the users to choose is MY first choice, but managers don't like this idea. Most users would probably know a location, but not an actual printer name. Not a problem as long as I meet with the managers and find out how they want the printers identified.

However, there are often 4 or 5 printers on one nursing unit (our units are set up with a central station and multiple small hubs around it). It seems like a good idea to name it based upon location, but we are constantly re-arranging our nursing units and they take their printers with them. So, naming a printer q-room2303 wasn't a good idea. Now it is in room 1169. Very messy. If I could live with renaming the printers each time a move occurred, it wouldn't be that bad.

Top
#105730 - 2003-10-13 10:27 PM Re: Primary computer group membership
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The problem is that without standardization you will not be able to create rules that can be processed automatically.
_________________________
There are two types of vessels, submarines and targets.

Top
#105731 - 2003-10-13 10:40 PM Re: Primary computer group membership
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
I have already enabled the creation of the printsetup.ini file so I have a list of the installed and default printers.

When a new computer is added, the creation of the printsetup.ini file would be done manually.

Currently the printstup.ini file that each workstation created exists in the following location: \\mrh-01\prtlog$\@wksta\printsetup.ini

I was planning on disabling writing to the printsetup.ini file that exists and duplicating the printers on the computer, removing and adding printers in this file as needed to setup the computers.

Let me know what is wrong with this setup, please.

I do know:
- I currently can't delete the printers from the workstations if they are installed but not in the printsetup.ini file
- There are a lot of subdirectories that have been created in the hidden share - is this a problem? Slow down script processing? Many start with an identical first 3-5 lettters, i.e., MRH-D-2K-0001, MRH-D-XP-0001; MRH-L-2K-0049, etc.

Top
Page 3 of 3 <123


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

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.09 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

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