#23427 - 2002-06-18 04:12 PM
Leave out Terminal Server
|
Ken C
Fresh Scripter
Registered: 2002-03-08
Posts: 7
|
Hi, I need to find a way to run our audit software on our 9x, and NT machines, but not have it run on our Terminal server Machines. The audit software is run by mapping a drive, running the exe file and then disconnecting the drive. Can this be done?
|
|
Top
|
|
|
|
#23429 - 2002-06-18 04:48 PM
Re: Leave out Terminal Server
|
Ken C
Fresh Scripter
Registered: 2002-03-08
Posts: 7
|
Opps, let try to add more.
I have some windows 9x and NT machines that log into the network, and the kix script runs the audit software to get the software from the local machine. Then the same machine opens the terminal client and logs into the terminal server and the same script runs, which the audit then runs on the terminal server. I would like to find a way that it only audits the users machines, and not when they log into the terminal server. After looking at more, I found out that I should not have to map the drive, but I can use the shell "\\server\share\audit.exe" to run the audit. Does that make sense?
|
|
Top
|
|
|
|
#23431 - 2002-06-18 05:25 PM
Re: Leave out Terminal Server
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Yes
There are a couple of things you can check for - the @PRODUCTSUITE and @PRODUCTTYPE macros will describe the operating system the script is loggin on.
If you are using an older version of KiXtart that does not have these macros then you may check for environment variables which are only defined under Terminal Server. Under Citrix there are things like %CLIENTNAME% and so-on which are only present when running the logon script as a thin client, so you can do:
code:
If "%CLIENTNAME%" = "" ; Run non-thin client code EndIf
or something similar.
|
|
Top
|
|
|
|
#23432 - 2002-06-18 10:18 PM
Re: Leave out Terminal Server
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Hmm..
@ProductSuite - That is Kix 4.x specific??
Did not see anything about the "environmental" variables..
Kix Version? Terminal Server - NT/2K/XP?
Thanks,
Kent
|
|
Top
|
|
|
|
#23433 - 2002-06-18 10:54 PM
Re: Leave out Terminal Server
|
Ken C
Fresh Scripter
Registered: 2002-03-08
Posts: 7
|
Well this is only my 3 or 4 time changing the kix script since I have started here so I am very much a newbie, and have never been very good with login scripts. One of those times was to upgrade kix to version 4.02, I looked in the manual and found @PRODUCTSUITE, Could I do something like this so that the audit software does not run on the terminal servers?
If @PRODUCTSUITE = 16 GOTO next shell "\\server\share\audit.exe" :next Endif
|
|
Top
|
|
|
|
#23434 - 2002-06-19 02:07 PM
Re: Leave out Terminal Server
|
cellnet
Starting to like KiXtart
Registered: 2002-02-26
Posts: 115
Loc: Sweden
|
Another way is
code:
IF @WKSTA = "teminalserver" SetConsole(maximize) CLS ? "Logging on to terminal" Sleep 2 Endif
Regards \erik
|
|
Top
|
|
|
|
#23436 - 2002-06-19 02:17 PM
Re: Leave out Terminal Server
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Ken, You're close, but your code would actually look like this:
code:
If @PRODUCTTYPE = 16 GoTo next EndIf shell "\\server\share\audit.exe :next
A cleaner and more easily understood solution would be:
code:
$TERMSERVER=16 If @PRODUCTTYPE <> $TERMSERVER shell "\\server\share\audit.exe EndIf
[ 19 June 2002, 14:20: Message edited by: Richard Howarth ]
|
|
Top
|
|
|
|
#23437 - 2002-06-19 03:35 PM
Re: Leave out Terminal Server
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
More info: The @productsuite macro returns a number that could include multiple product suite references. Therefore, bitwise operations have to be performed on the @productsuite value to properly determine is the value "16" (Terminal Server") is in use on any individual computer.
For example: If you install a W2K server and enable the 2-client Admin level Terminal services, @productsuite returns "274" which is a combination of "Enterprise" (2), "Terminal Server" (16), and "Single User Terminal Server" (256) --> 274.
So to determine that "Terminal Server" is part of the mix you have to perform a bitwise operation on the value.
This Function is one way to do that... code:
if ProductSuite("Terminal Server") CallScript("$HomeDrive\CitrixMap.kix") endif
Function ProductSuite ($Product) Dim $Product
select case $Product = "None" $x=0 case $Product = "Small Business" $x=1 case $Product = "Enterprise" $x=2 case $Product = "BackOffice" $x=4 case $Product = "CommunicationServer" $x=8 case $Product = "Terminal Server" $x=16 case $Product = "Small Business (Restricted)" $x=32 case $Product = "Embedded NT" $x=64 case $Product = "DataCenter" $x=128 case $Product = "Single User Terminal Server" $x=256 case $Product = "Home Edition" $x=512 case $Product = "Blade Server" $x=1024 case 1 $RC=MessageBox ("Invalid parameter used in function ProductSuite ($Product)",48) WriteLog("Invalid parameter used in function ProductSuite ($Product)") endselect
$ProductSuite = $x & val(@ProductSuite) Endfunction
[ 19 June 2002, 15:35: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#23439 - 2002-06-19 05:44 PM
Re: Leave out Terminal Server
|
Ken C
Fresh Scripter
Registered: 2002-03-08
Posts: 7
|
Thanks to everyone for all of your help... I can figure something out with all of your in put.
|
|
Top
|
|
|
|
#23441 - 2002-06-20 09:58 PM
Re: Leave out Terminal Server
|
Tarfin
Fresh Scripter
Registered: 2001-11-14
Posts: 26
Loc: Jenison, MI USA
|
Another method is to not run login scripts or portions of them from Terminal Servers. code:
If @wksta="TERMA" OR @wksta="TERMB" Exit
EndIf
|
|
Top
|
|
|
|
#23442 - 2002-06-28 03:59 PM
Re: Leave out Terminal Server
|
Glen Munday
Lurker
Registered: 2002-06-28
Posts: 1
|
Ive made it realy easy.
Make a text file called Terminal.srv on each of the terminal Servers windows directories then add in on the batch file which calls the log on script these lines.
IF EXIST %WINDIR%\TERMINAL.SRV GOTO TERMINAL
{put running script here.}
:Terminal
This is the simplest way I can find.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 688 anonymous users online.
|
|
|