code:
$WTSsession = $Win32Admin.WTSQuerySessionInfo("prodmf04", 622)
if VarTypeName($WTSsession) = "Variant[]"
For $i=0 to ubound($WTSsession) step 2
? $WTSsession[$i] + " = " + $WTSsession[$i+1]
Next
else
? "Error @serror"
endif

This is the output:
quote:
applicationname = #PC Master
clientaddress = 159.57.43.67
clientbuildnumber = 985
clientdirectory = C:\PROGRA~1\Citrix\ICACLI~1\
clientdisplay =
clienthardwareid = 0
clientname = AMP01-US054450
clientproductid = 1
connectstate = WTSActive
domainname = AMP01
initialprogram = icast.exe v:\pcmw30\pcmlaunch.cmd
oemid =
sessionid = 622
username = US054450
winstationname = ICA-tcp#622
workingdirectory = u:\wtsrv\profiles\%username%\personal



[ 05. September 2003, 01:57: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/