Page 1 of 1 1
Topic Options
#23427 - 2002-06-18 04:12 PM Leave out Terminal Server
Ken C Offline
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
#23428 - 2002-06-18 04:28 PM Re: Leave out Terminal Server
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Can you clarify whether the audit software is running on the machine being audited, or running on another machine which is mapping a drive to the machine being audited.
Top
#23429 - 2002-06-18 04:48 PM Re: Leave out Terminal Server
Ken C Offline
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
#23430 - 2002-06-18 05:20 PM Re: Leave out Terminal Server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
RTFM @ProductSuite
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#23431 - 2002-06-18 05:25 PM Re: Leave out Terminal Server
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Yes [Wink]

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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#23433 - 2002-06-18 10:54 PM Re: Leave out Terminal Server
Ken C Offline
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 Offline
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
#23435 - 2002-06-19 02:15 PM Re: Leave out Terminal Server
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ken, yes you can.

cheers,
_________________________
!

download KiXnet

Top
#23436 - 2002-06-19 02:17 PM Re: Leave out Terminal Server
Richard H. Administrator Offline
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 Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23438 - 2002-06-19 04:06 PM Re: Leave out Terminal Server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Do you want your script to run on any servers? I don't, so I check simply if a server and exit.

code:
;  check if logon to Server or Workstation
;PRODUCTTYPE - WinNT = Workstation, ServerNT = Member Server, LanmanNT = Domain Controller
;
$PRODUCTTYPE = READVALUE("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\PRODUCTOPTIONS","PRODUCTTYPE")
if $PRODUCTTYPE = "WinNT" goto NTwks endif

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#23439 - 2002-06-19 05:44 PM Re: Leave out Terminal Server
Ken C Offline
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
#23440 - 2002-06-20 05:29 PM Re: Leave out Terminal Server
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Since 'L', 'M', or 'N' are the default Citrix Drives this is what I use...
code:
:CITRIX
IF((%SYSTEMDRIVE% = L:)OR(%SYSTEMDRIVE% = M:)OR(%SYSTEMDRIVE% = N:))
? "[ You are logging into a Citrix Server ]"
? "[ The Login Script will exit without running ]" + @CRLF
SLEEP 3
GOTO END
ENDIF

HTH

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#23441 - 2002-06-20 09:58 PM Re: Leave out Terminal Server
Tarfin Offline
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 Offline
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
Page 1 of 1 1


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

Who's Online
0 registered and 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.233 seconds in which 0.048 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