|
|
|||||||
Hi, I created script that automatically connects our users to our network printer and sets a default printer in the process. Problem is when users set their own default printers, the process changes the default back to whatever is in the script when they relogin. Is there anyway to make kixtart not set a default printer if the user has manually set another default printer (such as a local printer)? Thanks. Brian |
||||||||
|
|
|||||||
well, you need to know when the user has set the printer and when it's set by the script. once you have that figured out, you can script it easily. |
||||||||
|
|
|||||||
AddPrinterConnection( ) should not be setting a default printer. That would be done with SetDefaultPrinter( ) If you want to remove a printer that is done with DelPrinterConnection( ) There are also a few Printer related UDFs if needed as well. Look on one of the UDF sites for a sorted list. http://www.kixhelp.com/udfs |
||||||||
|
|
|||||||
Thanks, I am aware of those three functions. I am trying to find out if there is an easy way that someone had already worked out to determine if a user had local printers set as default before the script changed it to the network printer. |
||||||||
|
|
|||||||
think what doc ment that if you just add printers, the current default printer will be default. anyways, what you need is a script that queries the current default printer. and such script can be found in the udf library. |
||||||||
|
|
|||||||
oh! You mean like this one? GetDefaultPrinter() - Returns default printer http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=117544 |
||||||||
|
|
|||||||
And this UDF will allow you to log all the printers installed on the system if wanted. EnumPrinterConnections2() - Enumerates all connected printers http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=137527 |
||||||||
|
|
|||||||
Just one question... How can a script tell if a user selected a default vs. the system picked the default? I mean, you ALWAYS have a default whether you choose or the system chooses for you. |
||||||||
|
|
|||||||
that's why I said that all you need to know is when it's set by user. rest is just downhill |
||||||||
|
|
|||||||
I know what you said Jooel, but you speak on such an esoteric level that one needs the delonkenizer 2.0 to decode. |
||||||||
|
|
|||||||
right... hmm. I thought the latest release was 1.7.4.23 |
||||||||
|
|
|||||||
Right again... 2.0 is vapourware |
||||||||
|
|
|||||||
BMM - I found this code on the boards. I don't actually use it to set my printers, I rem out the last lines so that I only record the current printers, but this looks like it might work for your needs. If there is a local printer set as default, it doesn't change to the network printer. You can populate the PrintSetup.ini with the printers you wish to add if there are none currently set. Code:
|
||||||||
|
|
|||||||
looks familiar... |
||||||||
|
|
|||||||
Yes, as I noted I found it on the boards here. The original links no longer work. Here they are: ;Re-Write at http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=004308 ;By Kdyer & Lonkero (15th april 2003) ;Re-Write of http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000021 * Edited to add a couple more that don't work, but were saved with script: ; Ref. http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=006790 ; Ref. http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000221 |
||||||||
|
|
|||||||
is either one supposed to work? |
||||||||
|
|
|||||||
Well, I must've believed they worked when I copied them into my script. It doesn't really matter if they work, I guess. I posted the script I found and partially use and was just indicating that it wasn't my script, but rather gathered from the boards. It is a nice nod to someone else if you can give them credit for their code and for helping those of us who are kix-challenged. Too bad I don't have working links.... |
||||||||
|
|
|||||||
hmmm... there is the one version by MCA in the FAQ: http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB10&Number=81655 |
||||||||
|
|
|||||||
I haven't seen that one before. Maybe that will work for BMM. |
||||||||
|
|
|||||||
actually, not so much of an FAQ as an function introduction post. the wanted UDF getdefaultPrinter is in the udf library collection. and shorter version: http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=117544 |
||||||||
|
|
|||||||
I use getdefaultprinter.udf in my user login script. I record the printer to a file on a server so that I can look up the default printer for computers if needed. This way if someone new signs onto a computer and wants a printer installed or if the printer is deleted, I know which one to install. I use this mainly for reference. For shared computers, I use different scripts to add and set default printers using Active Directory groups of some workstations for specific printers. I don't use this for computers that have only one user. |
||||||||
|
|
|||||||
eh, I thought you said setdefaultprinter overrides the old one? it still does that. now, on the next logon your getdefaultprinter would save the one set by your script as the default. I think you should just simply do: if not getdefaultprinter ;there is no defaultPrinter yet setdefaultprinter("\\serverDude\everyonesDefault") endif |
||||||||
|
|
|||||||
I write the results of default printer to a logfile that includes the date/time, username, and default printer EACH time a user logs into the computer. This isn't really necessary, so it will probably be disabled. I set this up when I was going to migrate from one print server to another (novell to ms). Now that I've setup the AD computer printer groups, it is simple to add printers to a workstation. The user calls complaining they can't print, I add their computer to appropriate computer group and have them login again. It works very slick for me. |
||||||||
|
|
|||||||
I personally don't care if the default printer gets overridden. The users can print where I set them up to print. If they don't like it, they'll call and I can put their workstations in the appropriate default printer group and additional printer groups and they'll be happy. Default printers don't change much unless a new printer is added. The majority of my computers are shared by 20+ nurses or therapists. They print to the closest printer. If they need color, it is an additional printer and they know how to change it. New computers added to the network are put into the same printer groups as the rest of the surrounding computers. Computers that are not shared, do not usually get printers assigned via kixtart and printer groups. |