Page 1 of 2 12>
Topic Options
#165607 - 2006-08-09 12:40 AM Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Does any know if there's a way to have KIX install specific printers to a group of computer name? For example: if the computer name is FA*, then install printerA, if computer name is FB*, then install printerB...Also, can wildcard be used in this case?

TIA.
Hieu

Top
#165608 - 2006-08-09 12:52 AM Re: Install Printers by Computer Names
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
If Left(@WKSTA,2) = "FA"
;map the printer
EndIf

If Left(@WKSTA,2) = "FB"
;map the printer
Endif

Top
#165609 - 2006-08-09 12:54 AM Re: Install Printers by Computer Names
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Something like:
Code:

Select
Case Left(@WKSTA,2) = "FA"
$ = AddPrinterConnection("\\Server\PrinterA")
Case Left(@WKSTA,2) = "FB"
$ = AddPrinterConnection("\\Server\PrinterB")
EndSelect


Top
#165610 - 2006-08-09 12:55 AM Re: Install Printers by Computer Names
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Whoops, too late
Top
#165611 - 2006-08-09 12:56 AM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Thanks Witto, Gargoyle! I'll give it a try and will post the result.

Hieu

Top
#165612 - 2006-08-09 01:25 AM Re: Install Printers by Computer Names
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
witto,
don't feel bad, gargoyle just did that to me too over at kforg, he has been realy sneaky the past couple days
or maybe i have been realy slow


Edited by benny69 (2006-08-09 01:26 AM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#165613 - 2006-08-09 01:58 AM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
One more thing, the printers are installed just fine using the code abovewhen logging in from a local ws, but when I login from Citrix, printers are not installed because I think it's picking up the Citrix server name instead of ws name. Any thought on how-to make it work...

Thanks!

Top
#165614 - 2006-08-09 02:00 AM Re: Install Printers by Computer Names
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Search the board for Terminal Server as this has been discussed quite a few times recently. There may even be a dedicated FAQ on it, but not positive.
Top
#165615 - 2006-08-09 02:17 AM Re: Install Printers by Computer Names
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, there is a FAQ on determining the clientname while logging on to the terminal server.
Top
#165616 - 2006-08-09 02:28 AM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Les, NTDOC, can you please point me to the FAQ link for this topic as I am having trouble finding it. When I click on the FAQ above the tread, it contains only how-to use this forum.

Please help.
Thank you!

Top
#165617 - 2006-08-09 02:34 AM Re: Install Printers by Computer Names
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Use the board search http://www.kixtart.org/ubbthreads/search.php?Cat= and search for Citrix in the KiXtart FAQ and HowTo's forum.
Top
#165618 - 2006-08-09 02:37 AM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Got it! Thank You!
Top
#165619 - 2006-08-09 06:18 AM Re: Install Printers by Computer Names
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
AFAIK, Citrix can map printers via it's own policies, a copy of the installed printers on the local computer. But I do not know if this is preferable.
Top
#165620 - 2006-08-09 07:06 AM Re: Install Printers by Computer Names
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Code:

If Not @TSSESSION
$ComputerName = @WKSTA
Else
$ComputerName = %CLIENTNAME%
EndIf
Select
Case Left($ComputerName,2) = "FA"
$ = AddPrinterConnection("\\Server\PrinterA")
Case Left($ComputerName,2) = "FB"
$ = AddPrinterConnection("\\Server\PrinterB")
EndSelect


Top
#165621 - 2006-08-09 07:36 PM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Thanks, Witto!!! Your code worked great on both workstation and in Citrix!
Top
#165622 - 2006-08-09 08:35 PM Re: Install Printers by Computer Names
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
You're welcome.
Top
#165623 - 2006-08-09 08:47 PM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Witto - Just another thought, can specific printers be installed by specific subnet only?

Thanks much.

Top
#165624 - 2006-08-09 08:53 PM Re: Install Printers by Computer Names
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure.
Top
#165625 - 2006-08-09 09:11 PM Re: Install Printers by Computer Names
hieucao Offline
Fresh Scripter

Registered: 2006-08-09
Posts: 18
Great, Jooel - is it possible if you can post the code? I am a newbie in KIX but so far KIX has been working great with eveyone's help.

Thanks.

Top
#165626 - 2006-08-09 09:20 PM Re: Install Printers by Computer Names
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
If instr(@IPAdress, $Subnet)
$ = AddPrinterConnection("\\Server\PrinterA")
EndIf

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 809 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.044 seconds in which 0.015 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