NKK
(Fresh Scripter)
2005-07-07 11:13 PM
Trackit and Citrix Metaframe XP

Situation. I am using a pgm called Trackit to audit users computers and audit their system. I want this to only happen on their local computers. Our remote users login to their local computer and then start a citrix session - I do not want the user to run the part of the Kix script that runs Trackit if they are logging onto a Citrix session they need to run the rest of the script to get their mappings, etc. Remote users local computers have either win2k or winxp on them. Thanks.

Bryce
(KiX Supporter)
2005-07-07 11:24 PM
Re: Trackit and Citrix Metaframe XP

the new 4.50 version of Kix has a new Citrix/term service macro.

Les
(KiX Master)
2005-07-08 02:13 AM
Re: Trackit and Citrix Metaframe XP

Even if you don't use the latest version, there is a FAQ that covers this topic.

NKK
(Fresh Scripter)
2005-07-08 03:51 PM
Re: Trackit and Citrix Metaframe XP

If I add this to the top of my Main login Script - it is suppose to check if the users is logging into local or a Citrix Session. If it is a Citrix session it is suppose to call the Citrix Script for mapping drives. What is wrong with this code? Thanks from a new scripter.

CODE
; Determine if Logging into Citrix or Local
Function ProductSuite ($Product)
Dim $Product
SELECT
Case $Product = "None" Select $x=0
Case $Product = "Small Business" $x=1
Case $Product = "Enterprise" $x=2
Case $Product = "BackOffice" $x=4
Case $Product = "CommunicationsServer" $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
ProductSutie ($Product)",48
WriteLog("Invalid parameter used in function ProductSuite ($Product)")
Endselect
$ProdcutSuite = $x & val(@ProductSuite)
Endfunction
If ProductSuite("Terminal Server") and not ProductSuite("Singel User Terminal Server")
CallScript("$HomeDrive\Citrixmap.kix")
endif
EXIT


NKK
(Fresh Scripter)
2005-07-08 03:54 PM
Re: Trackit and Citrix Metaframe XP

I am using Kix32.exe from 12/28/04

Les
(KiX Master)
2005-07-08 03:56 PM
Re: Trackit and Citrix Metaframe XP

You need a spellchecker.
("Singel User Terminal Server")


NKK
(Fresh Scripter)
2005-07-08 04:14 PM
Re: Trackit and Citrix Metaframe XP

Les ??? Single is correct spelling, is it not?

NKK
(Fresh Scripter)
2005-07-08 04:31 PM
Re: Trackit and Citrix Metaframe XP

When I test run the script I see "Invaild Method/function call:missing comma"

Missing where?


NKK
(Fresh Scripter)
2005-07-08 04:46 PM
Re: Trackit and Citrix Metaframe XP

I am trying to find where I saw this example of script so I can proof mine. Les you wrote it, I think. Where is it? Thanks.

maciep
(Korg Regular)
2005-07-08 04:57 PM
Re: Trackit and Citrix Metaframe XP

this?

Citrix FAQ

Also, "Single" is the correct spelling, "Singel" is not. Look at the code you posted again.

Code:

If ProductSuite("Terminal Server") and not ProductSuite("Singel User Terminal Server")
CallScript("$HomeDrive\Citrixmap.kix")
endif



NKK
(Fresh Scripter)
2005-07-08 05:07 PM
Re: Trackit and Citrix Metaframe XP

Ok got that fixed now I am getting the no ENDFUNCTION for FUNCTION Productsuite

maciep
(Korg Regular)
2005-07-08 05:11 PM
Re: Trackit and Citrix Metaframe XP

copy and paste issues?

Case 1 $RC=MessageBox ("Invalid parameter used in function
ProductSutie ($Product)",48)

also, it looks like that function is using the WriteLog() UDF . May just want to comment (;) that line out or copy the udf and put it in your script...


NKK
(Fresh Scripter)
2005-07-08 05:17 PM
Re: Trackit and Citrix Metaframe XP

Probably maciep. Still getting "Missing Endfunction".

Richard H.Administrator
(KiX Supporter)
2005-07-08 05:25 PM
Re: Trackit and Citrix Metaframe XP

What's the select doing in this line:
Code:
Case $Product = "None" Select $x=0



That's gonna cause you problems too.


maciep
(Korg Regular)
2005-07-08 05:30 PM
Re: Trackit and Citrix Metaframe XP

definitely copy and paste issues...

Code:

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

if ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")
;CallScript("$HomeDrive\CitrixMap.kix")
endif



by the way, the "missing endfunction" error is probably being caused because the messagebox call is going across two lines which is f-ing up the quotes


NKK
(Fresh Scripter)
2005-07-08 05:38 PM
Re: Trackit and Citrix Metaframe XP

Have no idea. Got script example from this website. Just trying to:
Users login to local computer get #1 Kix script that runs Trackit pgm
Remote users then start a Citrix XP session and do NOT need to run the Trackit pgm, just the rest of the script for drive mappings. Maybe I can take all the "case" statements out except the one for "Single User Terminal Server" and see if it will work. I am very ignorant at this point. Sorry.


NKK
(Fresh Scripter)
2005-07-08 05:40 PM
Re: Trackit and Citrix Metaframe XP

There is something wrong with the syntax - Missing ENDFUNCTION error.

maciep
(Korg Regular)
2005-07-08 05:46 PM
Re: Trackit and Citrix Metaframe XP

did you read my "by the way" above? repost the code you are using.

NKK
(Fresh Scripter)
2005-07-08 05:58 PM
Re: Trackit and Citrix Metaframe XP

It is something wrong with the msg line - I commented it out and the script is running, at least on local computer. Going to test on Citrix login.

maciep
(Korg Regular)
2005-07-08 06:01 PM
Re: Trackit and Citrix Metaframe XP

this

Code:

Case 1 $RC=MessageBox ("Invalid parameter used in function
ProductSutie ($Product)",48)



needs to be this

Code:

Case 1 $RC=MessageBox ("Invalid parameter used in function ProductSutie ($Product)",48)



NKK
(Fresh Scripter)
2005-07-08 06:25 PM
Re: Trackit and Citrix Metaframe XP

Following is code for script.
user just logging into local computer - run all the script including the trackit statements
user logging into citrix session call the citrixmap.kix script runs everything BUT the trackit and quit.

Not working goes all the way through to trackit no matter if logging into local or citrix session. Just the first section of added code needs to be reviewed and how I end the Citrixmap.kix script. I really appreciate all of you and your patience with my ignorance - I always heard "Stupid is forever; Ignorance can be fixed".

(CODE)
; LOG-IN SCRIPT
; Determine if Logging into Citrix or Local
******NEWLY ADDED CODE **********************************************
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 = "CommunicationsServer" $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
$ProdcutSuite = $x & val (@ProductSuite)
EndFunction
If ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")

CallScript("\\xcompany-americas.com\netlogon\Citrixmap.kix")
endif
***********END OF NEWLY ADDED CODE ******************************************

CLS

$section=1 ;Section 1
Color c+/n
Box (0,0,24,79,single)

Color r+/n
At (10,30) "Welcome to the"
At (12,32) @domain
At (12,37) "Domain"
At (14,30) "XCOMPANY Americas Inc."
At (16,30) @fullname
At (18,20) "Intended for XCOMPANY Employee use only."
At (20,20) "All intruders will be prosecuted to"
At (21,23) "the fullest extent of the law."

Sleep 3

Small
Color b+/n
Box (0,0,24,79,GRID) ; 'background grid'
Color b/n
Box (8,21,18,61,Å) ; 'shadow' of the box
Color g+/n
Box (7,20,17,60,FULL)
0
SetTime $Server3

Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
At (16,25) "Today's Date : "

Color y+/n
At ( 9,40) @userid ; ...and some macro's
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
At (16,40) @DATE
Sleep 3

:set_vars
$section=$section+1 ; Section 2
Use "*" /delete
$h="\\wmcfps02\@userid"
;$s="\\wmcfps01\@PRIMARYGROUP"

CLS
At (12,30) "Mapping Drives"
Sleep 3

; For Marshall

if ingroup("XX-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Marshall\home\%username%"
use g: "\\xx-fs\Marshall\depts"
use l: "\\xx-fs\Enterprise"
use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\marshall"
endif


; PRYOR
if ingroup("OK-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Pryor\home\%username%"
use g: "\\xx-fs\Pryor\depts"
use l: "\\xx-fs\Enterprise"
;use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\Pryor"
endif


;MACOLA
if ingroup("XX-Macola Access")
Use M: /delete
USE M: "\\Xx-Apps\Apps"
endif

;MAPCON
if ingroup("XX-Mapcon")
Use O: /delete
USE O: "\\Xx-Apps\Apps2"
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\mapcon.lnk" $desktop
endif

; ISO QUALITY SYSTEM
if ingroup("XX-Everyone")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\ISO Index.lnk" $desktop
endif


; PRODUCTION PRINTER
if ingroup("XX-Production-All")
ADDPRINTERCONNECTION ("\\xx-dc2\xx-plant central control-dell laser-ps")
endif

; BEMIS PRINTER
if ingroup("XX-Bemis")
ADDPRINTERCONNECTION("\\xx-dc2\xx-plant-bemis-HP5N")
endif

; LIMS
if ingroup("XX-LIMS")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\lims.lnk" $desktop
endif

;ORDERS
if ingroup("XX-Orders")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\orders schedule database.lnk" $desktop
endif

;QUALITY
if ingroup("XX-Quality-System-DB")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\Quality System Database.lnk" $desktop
endif

;PRODUCTION Database Read Write
if ingroup("XX-Production-Database-RW")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\Production Database.lnk" $desktop
endif

;PRODUCTION Database for PLANT Users
if ingroup("XX-Production-Database-Plant")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\productiondb.lnk" $desktop
ADDPRINTERCONNECTION ("\\xx-dc2\xx-plant central control-dell laser-ps")
endif

;TRAINING
if ingroup("XX-Everyone")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xcompany-americas.com\netlogon\shortcuts\Xcompany Training.url" $desktop
endif

;TRACKIT Uninstall
if ingroup("Uninstall-Trackit")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
RUN 'T:\installers\workstationmanager\tiwsmgr.exe /uninstall'
? "Please WAIT * Uninstall Trackit Running here"

SLEEP 20

Endif


;MARSHALL TRACKIT Tiwsmgr
if ingroup("XX-Everyone")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
RUN 'T:\installers\workstationmanager\tiwsmgr.exe /service'
? "Please WAIT * Trackit Service Installing"

SLEEP 6
Endif



;TRACKIT Audit32
if ingroup("XX-Everyone")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
RUN 'T:\Audit32.exe /m /q'
? "Please WAIT * Trackit Audit Running. This will run once a day at LOGIN"

SLEEP 4
Endif

;PRYOR TRACKIT Tiwsmgr
if ingroup("OK-Trackit")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
RUN 'T:\installers\workstationmanager\tiwsmgr.exe /service'
? "Please WAIT * Trackit Service Installing"

SLEEP 30
Endif



;TRACKIT Audit32
if ingroup("OK-Trackit")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
RUN 'T:\Audit32.exe /m /q'
? "Please WAIT * Trackit Audit of System Running. This will run once a day at LOGIN"

SLEEP 20
Endif

(END CODE)


CITRIXMAP SCRIPT BEGINS HERE
(CODE)
;Drive Mappings for Citrix Users - NO Trackit

CLS
?"Running Citrix Mapping now"
Sleep 5
$section=1 ;Section 1
Color c+/n
Box (0,0,24,79,single)

Color r+/n
At (10,30) "Welcome to the"
At (12,32) @domain
At (12,37) "Domain"
At (14,30) "XCOMPANY Americas Inc."
At (16,30) @fullname
At (18,20) "Intended for XCOMPANY Employee use only."
At (20,20) "All intruders will be prosecuted to"
At (21,23) "the fullest extent of the law."
At (22,20) "THIS SCRIPT RUNNING FOR CITRIX USERS ONLY"
Sleep 3

Small
Color b+/n
Box (0,0,24,79,GRID) ; 'background grid'
Color b/n
Box (8,21,18,61,Å) ; 'shadow' of the box
Color g+/n
Box (7,20,17,60,FULL)
0
SetTime $Server3

Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
At (16,25) "Today's Date : "

Color y+/n
At ( 9,40) @userid ; ...and some macro's
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
At (16,40) @DATE
Sleep 3

:set_vars
$section=$section+1 ; Section 2
Use "*" /delete
$h="\\wmcfps02\@userid"
;$s="\\wmcfps01\@PRIMARYGROUP"

CLS
At (12,30) "Mapping Drives"
Sleep 3

; For Marshall

if ingroup("XX-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Marshall\home\%username%"
use g: "\\xx-fs\Marshall\depts"
use l: "\\xx-fs\Enterprise"
use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\marshall"
endif


; PRYOR
if ingroup("OK-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Pryor\home\%username%"
use g: "\\xx-fs\Pryor\depts"
use l: "\\xx-fs\Enterprise"
;use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\Pryor"
endif


;MACOLA
if ingroup("XX-Macola Access")
Use M: /delete
USE M: "\\Xx-Apps\Apps"
endif

;MAPCON
if ingroup("XX-Mapcon")
Use O: /delete
USE O: "\\Xx-Apps\Apps2"
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\mapcon.lnk" $desktop
endif

; ISO QUALITY SYSTEM
if ingroup("XX-Everyone")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\ISO Index.lnk" $desktop
endif


; PRODUCTION PRINTER
if ingroup("XX-Production-All")
ADDPRINTERCONNECTION ("\\xx-dc2\xx-plant central control-dell laser-ps")
endif

; BEMIS PRINTER
if ingroup("XX-Bemis")
ADDPRINTERCONNECTION("\\xx-dc2\xx-plant-bemis-HP5N")
endif

; LIMS
if ingroup("XX-LIMS")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\lims.lnk" $desktop
endif

;ORDERS
if ingroup("XX-Orders")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\orders schedule database.lnk" $desktop
endif

;QUALITY
if ingroup("XX-Quality-System-DB")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\Quality System Database.lnk" $desktop
endif

;PRODUCTION Database Read Write
if ingroup("XX-Production-Database-RW")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\Production Database.lnk" $desktop
endif

;PRODUCTION Database for PLANT Users
if ingroup("XX-Production-Database-Plant")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\productiondb.lnk" $desktop
ADDPRINTERCONNECTION ("\\xx-dc2\xx-plant central control-dell laser-ps")
endif

;TRAINING
if ingroup("XX-Everyone")
$desktop = READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")copy "\\xxx-xxx.com\netlogon\shortcuts\Xcompany Training.url" $desktop
endif
EXIT
(END CODE)
************* IS EXIT correct?


Les
(KiX Master)
2005-07-08 06:53 PM
Re: Trackit and Citrix Metaframe XP

I'm not seeing a CallScript() UDF anywhere nor do I see an EXIT or QUIT that would prevent you from falling into the remaining script.

maciep
(Korg Regular)
2005-07-08 07:30 PM
Re: Trackit and Citrix Metaframe XP

Code:

If ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")
Call "\\xcompany-americas.com\netlogon\Citrixmap.kix"
Exit 0
endif



NKK
(Fresh Scripter)
2005-07-08 07:49 PM
Re: Trackit and Citrix Metaframe XP

Which value means the user is a citrix user? The single user terminal server?

Les
(KiX Master)
2005-07-08 08:03 PM
Re: Trackit and Citrix Metaframe XP

I guess you did not read my FAQ.

Les
(KiX Master)
2005-07-08 08:05 PM
Re: Trackit and Citrix Metaframe XP

Sweet suit!

NKK
(Fresh Scripter)
2005-07-08 08:13 PM
Re: Trackit and Citrix Metaframe XP

I am under the gun here. Over 350 users and I am the Network Admin, Security Admin, SQL Admin, CRM Admin, Disaster Recovery Admin, Help Desk. I work for a co that believes in a SLIM IS dept. Now I have to do the scripting as well. Excuse me for not knowing everything on this site.

maciep
(Korg Regular)
2005-07-08 08:27 PM
Re: Trackit and Citrix Metaframe XP

copy and paste disease seems to be contagious Fixed my post

maciep
(Korg Regular)
2005-07-08 08:31 PM
Re: Trackit and Citrix Metaframe XP

i think they're both needed to determine if it's a citrix session. Explain what's (not) happening during logon.

NKK
(Fresh Scripter)
2005-07-08 08:36 PM
Re: Trackit and Citrix Metaframe XP

Ok, I broke it down smaller for testing. Below is what I have. I login to a Citrix Desktop Session and I get as far as "Getting Ready to Check". No mapping from the Citrixmap.kix take place.

(BEGIN CODE)
;TESTING LOGIN SCRIPT
; Determine if Logging into Citrix or Local

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 = "CommunicationsServer" $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

$ProdcutSuite = $x & val (@ProductSuite)
EndFunction
?"Getting ready to check"
Sleep 6
If ProductSuite("Terminal Server") and not ProductSuit("Single User Terminal Server")
?"IM at the ProductSuite line here"
sleep 10
CallScript("\\norit-americas.com\netlogon\Citrixmap.kix")

EXIT 0
(END CODE)


*****************************HERE is the CALLED SCRIPT CODE
(BEGIN CODE)
;Drive Mappings for Citrix Users - NO Trackit

CLS
?"Running Citrix Mapping now"
Sleep 5
$section=1 ;Section 1
Color c+/n
Box (0,0,24,79,single)

Color r+/n
At (10,30) "Welcome to the"
At (12,32) @domain
At (12,37) "Domain"
At (14,30) "NORIT Americas Inc."
At (16,30) @fullname
At (18,20) "Intended for NORIT Employee use only."
At (20,20) "All intruders will be prosecuted to"
At (21,23) "the fullest extent of the law."
At (22,20) "THIS SCRIPT RUNNING FOR CITRIX USERS ONLY"
Sleep 3

Small
Color b+/n
Box (0,0,24,79,GRID) ; 'background grid'
Color b/n
Box (8,21,18,61,Å) ; 'shadow' of the box
Color g+/n
Box (7,20,17,60,FULL)
0
SetTime $Server3

Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
At (16,25) "Today's Date : "

Color y+/n
At ( 9,40) @userid ; ...and some macro's
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
At (16,40) @DATE
Sleep 3

:set_vars
$section=$section+1 ; Section 2
Use "*" /delete
$h="\\wmcfps02\@userid"
;$s="\\wmcfps01\@PRIMARYGROUP"

CLS
At (12,30) "Mapping Drives"
Sleep 3

; For Marshall

if ingroup("XX-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Marshall\home\%username%"
use g: "\\xx-fs\Marshall\depts"
use l: "\\xx-fs\Enterprise"
use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\marshall"
endif


; PRYOR
if ingroup("OK-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Pryor\home\%username%"
use g: "\\xx-fs\Pryor\depts"
use l: "\\xx-fs\Enterprise"
;use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\Pryor"
endif


(END CODE)


maciep
(Korg Regular)
2005-07-08 08:43 PM
Re: Trackit and Citrix Metaframe XP

as les so cleverly pointed out, there was a typo

If ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")
?"IM at the ProductSuite line here"
sleep 10
Call "\\norit-americas.com\netlogon\Citrixmap.kix"
Exit 0
endif


On top of that you didn't have an endif and you are still trying to use CallScript()...


NKK
(Fresh Scripter)
2005-07-08 08:48 PM
Re: Trackit and Citrix Metaframe XP

I login to my local xp computer then start a Citrix Desktop Session,
I do not think the condition is being met for the script to be called. That is why I was asking what conditions must be met for the script to know that I am trying to login to the Citrix desktop.


Les
(KiX Master)
2005-07-08 08:49 PM
Re: Trackit and Citrix Metaframe XP

CallScript() and Suite, not Suit!

NKK
(Fresh Scripter)
2005-07-08 08:52 PM
Re: Trackit and Citrix Metaframe XP

WIll correct and try.

NKK
(Fresh Scripter)
2005-07-08 08:58 PM
Re: Trackit and Citrix Metaframe XP

OK, just for testing;Does not go past "getting ready to check"

(CODE)
; LOG-IN SCRIPT
; Determine if Logging into Citrix or Local

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 = "CommunicationsServer" $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

$ProdcutSuite = $x & val (@ProductSuite)
EndFunction
?"Getting ready to check"

Sleep 6
If ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")

?"IM at the ProductSuite line here"
sleep 10

;Drive Mappings for Citrix Users - NO Trackit

CLS
?"Running Citrix Mapping now"
Sleep 5
$section=1 ;Section 1
Color c+/n
Box (0,0,24,79,single)

Color r+/n
At (10,30) "Welcome to the"
At (12,32) @domain
At (12,37) "Domain"
At (14,30) "XXX Americas Inc."
At (16,30) @fullname
At (18,20) "Intended for XXX Employee use only."
At (20,20) "All intruders will be prosecuted to"
At (21,23) "the fullest extent of the law."
At (22,20) "THIS SCRIPT RUNNING FOR CITRIX USERS ONLY"
Sleep 3

Small
Color b+/n
Box (0,0,24,79,GRID) ; 'background grid'
Color b/n
Box (8,21,18,61,Å) ; 'shadow' of the box
Color g+/n
Box (7,20,17,60,FULL)
0
SetTime $Server3

Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
At (16,25) "Today's Date : "

Color y+/n
At ( 9,40) @userid ; ...and some macro's
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
At (16,40) @DATE
Sleep 3

:set_vars
$section=$section+1 ; Section 2
Use "*" /delete
$h="\\wmcfps02\@userid"
;$s="\\wmcfps01\@PRIMARYGROUP"

CLS
At (12,30) "Mapping Drives"
Sleep 3

; For Marshall

if ingroup("XX-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Marshall\home\%username%"
use g: "\\xx-fs\Marshall\depts"
use l: "\\xx-fs\Enterprise"
use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\marshall"
endif


; PRYOR
if ingroup("OK-Everyone")
use h: /delete/persistent
use g: /delete/persistent
use l: /delete/persistent
use p: /delete/persistent
use h: "\\xx-fs\Pryor\home\%username%"
use g: "\\xx-fs\Pryor\depts"
use l: "\\xx-fs\Enterprise"
;use p: "\\xx-fs\Marshall\policies"
use f: /delete/persistent
use f: "\\xx-fs\Pryor"
endif



;CallScript("\\xxx-americas.com\netlogon\Citrixmap.kix")

;EXIT 0
endif
(CODE)


NKK
(Fresh Scripter)
2005-07-08 09:04 PM
Re: Trackit and Citrix Metaframe XP

Ok guys found another error and fixed it and it is going all the way through the test script in previous post. I think I need a typing class. Now I will test it with calling the script.

NKK
(Fresh Scripter)
2005-07-08 09:18 PM
Re: Trackit and Citrix Metaframe XP

To call a script is it
CallScript()
"\\path\scriptname"


NKK
(Fresh Scripter)
2005-07-08 09:29 PM
Re: Trackit and Citrix Metaframe XP

CallScript("\\domain name\netlogon\citrixmap.kix)
Gives UNKNOWN COMMAND (CALLSCRIPT) error.


NKK
(Fresh Scripter)
2005-07-08 09:31 PM
Re: Trackit and Citrix Metaframe XP

Left off ending " it is there and still error.

maciep
(Korg Regular)
2005-07-08 09:31 PM
Re: Trackit and Citrix Metaframe XP

it's just plain old call, like i showed you before

call "\\domain name\netlogon\citrixmap.kix"

Call Command


NKK
(Fresh Scripter)
2005-07-08 09:35 PM
Re: Trackit and Citrix Metaframe XP

THANKS! Your are all geniuses!

maciep
(Korg Regular)
2005-07-08 09:43 PM
Re: Trackit and Citrix Metaframe XP

sounds like it's working...glad to help

NKK
(Fresh Scripter)
2005-07-08 09:54 PM
Re: Trackit and Citrix Metaframe XP

Thanks for your patience!

NTDOCAdministrator
(KiX Master)
2005-07-09 12:55 AM
Re: Trackit and Citrix Metaframe XP

Well here is the code re-written some with notes.
Personally I didn't look it over that much but the CITRIX script doesn't look all that different then the main script.

 
Break On
Dim $h,$s,$Desktop
CLS


'Checking for Terminal Server session: ' ?
If ProductSuite("Terminal Server") And Not ProductSuite("Single User Terminal Server")
'This is a Terminal Server Session: ' ?
Sleep 5
Call '\\norit-americas.com\netlogon\Citrixmap.kix'
Exit 0
Else
;This is NOT a Terminal Server Session do not call the citrix script
EndIf
Sleep 5


;Start script for non Citrix users
SMALL
Color b+/n
BOX (0,0,24,79,GRID) ; background grid
Color b/n
BOX (2,3,13,77,Å) ; shadow of the box
Color g+/n
BOX (1,2,12,76,FULL) ; Green box
Color b+/n
If ((@TIME > "00:00:00") And (@TIME < "12:00:00"))
AT(10,5) "Good Morning " + @FullName
AT(11,5) "You are entering the " + @DOMAIN + " domain."
Color b+/n
Else
Color r+/n
If ((@TIME > "12:00:00") And (@TIME < "18:00:00"))
AT(10,5) "Good Afternoon " + @FullName
AT(11,5) "You are entering the " + @DOMAIN + " domain."
Color r+/n
Else
AT(10,5) "Good Evening " + @FullName
AT(11,5) "You are entering the " + @DOMAIN + " domain."
Color b+/n
EndIf
EndIf
Color w+/n
At (2,5) "Userid : " ; display some text strings
At (3,5) "Full name : "
At (4,5) "Privilege : "
At (5,5) "Workstation : "
At (6,5) "Domain : "
At (7,5) "Logon Server : "
At (8,5) "Current Time : "
At (9,5) "Today's Date : "
Color y+/n
At (2,20) @UserID ; ...and some macro's
At (3,20) @FullName
At (4,20) @Priv
At (5,20) @WkSta
At (6,20) @Domain
At (7,20) @LServer
At (8,20) @Time
At (9,20) @Date


;Now display some legal information
Sleep 5
CLS
SMALL
Color b+/n
BOX (0,0,24,79,GRID) ; background grid
Color b/n
BOX (2,3,13,77,Å) ; shadow of the box
Color g+/n
BOX (1,2,12,76,FULL) ; Green box
Color r+/n
At (2,5) "XCOMPANY Americas Inc."
At (3,5) "Intended for XCOMPANY Employee use only."
At (4,5) "All intruders will be prosecuted to"
At (5,5) "the fullest extent of the law."


Sleep 5


;SetTime $Server3
;$Server3 is not set or declared anywhere that I see


;:set_vars
;No need to use labels
;$section=$section+1 ; Section 2
;See no reason in the code so far for the $Section variable


Use "*" /delete /persistent
;This will delete all drive mappings every logon for all users


;You set these variables but then don't ever call or use them
;$h="\\wmcfps02\"+@UserID
;$s="\\wmcfps01\@PRIMARYGROUP"


CLS
At (12,30) "Mapping Drives"
Sleep 3


;Set the variable $Desktop for future use
$Desktop = ExpandEnvironmentVars(ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders','Desktop'))




; For Marshall
If InGroup("XX-Everyone")
;No need for this code as the code above removes all drive mappings
;for all users already
;use g: /delete/persistent
;use l: /delete/persistent
;use p: /delete/persistent
use h: "\\xx-fs\Marshall\home\"+@UserID
use g: "\\xx-fs\Marshall\depts"
use l: "\\xx-fs\Enterprise"
use p: "\\xx-fs\Marshall\policies"
;use f: /delete/persistent
use f: "\\xx-fs\marshall"
EndIf


; PRYOR
If InGroup("OK-Everyone")
use h: "\\xx-fs\Pryor\home\"+@UserID
use g: "\\xx-fs\Pryor\depts"
use l: "\\xx-fs\Enterprise"
use f: "\\xx-fs\Pryor"
EndIf


;MACOLA
if ingroup("XX-Macola Access")
Use M: /delete
USE M: "\\Xx-Apps\Apps"
endif


;MAPCON
If InGroup("XX-Mapcon")
;All drives are already unmapped from above code
;Use O: /delete
USE O: "\\Xx-Apps\Apps2"
Copy "\\xcompany-americas.com\netlogon\shortcuts\mapcon.lnk" $Desktop
EndIf


; ISO QUALITY SYSTEM
If InGroup("XX-Everyone")
Copy "\\xcompany-americas.com\netlogon\shortcuts\ISO Index.lnk" $Desktop
EndIf


; PRODUCTION PRINTER
If InGroup("XX-Production-All")
AddPrinterConnection("\\xx-dc2\xx-plant central control-dell laser-ps")
EndIf


; BEMIS PRINTER
If InGroup("XX-Bemis")
AddPrinterConnection("\\xx-dc2\xx-plant-bemis-HP5N")
EndIf


; LIMS
If InGroup("XX-LIMS")
Copy "\\xcompany-americas.com\netlogon\shortcuts\lims.lnk" $Desktop
EndIf


;ORDERS
If InGroup("XX-Orders")
Copy "\\xcompany-americas.com\netlogon\shortcuts\orders schedule database.lnk" $Desktop
EndIf


;QUALITY
If InGroup("XX-Quality-System-DB")
Copy "\\xcompany-americas.com\netlogon\shortcuts\Quality System Database.lnk" $Desktop
EndIf


;PRODUCTION Database Read Write
If Ingroup("XX-Production-Database-RW")
Copy "\\xcompany-americas.com\netlogon\shortcuts\Production Database.lnk" $Desktop
EndIf


;PRODUCTION Database for PLANT Users
If InGroup("XX-Production-Database-Plant")
Copy "\\xcompany-americas.com\netlogon\shortcuts\productiondb.lnk" $Desktop
AddPrinterConnection("\\xx-dc2\xx-plant central control-dell laser-ps")
EndIf


;TRAINING
If InGroup("XX-Everyone")
Copy "\\xcompany-americas.com\netlogon\shortcuts\Xcompany Training.url" $Desktop
EndIf


;TRACKIT Uninstall
If InGroup("Uninstall-Trackit")
;All drives should already be unmapped from above code
;use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"


;If you use SHELL it should wait until the process is completed before
;returning to the script
;RUN 'T:\installers\workstationmanager\tiwsmgr.exe /uninstall'
"Please WAIT * Uninstall Trackit Running here" ?
SHELL '%comspec% /e:1024 /c T:\installers\workstationmanager\tiwsmgr.exe /uninstall'
;Don't think it should be needed. Also why not check to verify if the
;software is even installed before calling an uninstall
;SLEEP 20
EndIf


;MARSHALL TRACKIT Tiwsmgr
If InGroup("XX-Everyone")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
"Please WAIT * Trackit Service Installing" ?
SHELL '%comspec% /e:1024 /c T:\installers\workstationmanager\tiwsmgr.exe /service'
;RUN 'T:\installers\workstationmanager\tiwsmgr.exe /service'
;No need to sleep with the Shell


;Users probably need to have local Admin rights to install software
;but you don't even check
;SLEEP 6
Endif


;TRACKIT Audit32
If InGroup("XX-Everyone")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
"Please WAIT * Trackit Audit Running. This will run once a day at LOGIN" ?
SHELL '%comspec% /e:1024 /c T:\Audit32.exe /m /q'
;RUN 'T:\Audit32.exe /m /q'
;No need to sleep with Shell
;SLEEP 4
EndIf


;PRYOR TRACKIT Tiwsmgr
If InGroup("OK-Trackit")
use T: /delete/persistent
use T: "\\xx-apps2\intuit\Track-IT! 6.5\Track-It! Server - Professional Edition"
SHELL '%comspec% /e:1024 /c T:\installers\workstationmanager\tiwsmgr.exe /service'
"Please WAIT * Trackit Service Installing" ?
;Certainly you must get errors by running this every logon
;RUN 'T:\installers\workstationmanager\tiwsmgr.exe /service'
;No need for Sleep with Shell I don't think
;SLEEP 30
EndIf


;******* User Defined Functions ****************
;***********************************************


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 Exit 1
EndSelect
If ($x & Val(@ProductSuite))
$ProductSuite = 1
Else
$ProductSuite = 0
EndIf
Endfunction


 


Sealeopard
(KiX Master)
2005-07-09 10:33 PM
Re: Trackit and Citrix Metaframe XP

And I hope you've been using DEBUG ON for allthe debugging you've done. That should have identified a lot of the issues.