#204423 - 2012-03-08 03:54 PM
kix with 2008r2 terminalserver + %clientname%
|
hama007
Fresh Scripter
Registered: 2008-05-13
Posts: 5
|
hi have a problem with windows 2008 terminalserver and kix
on my running windows terminalserver 2003 i can use in the kix %clientname% on the new windows 2008 ts i run my script and have no output for %clientname%
i open cmd.exe and start my kix script manual, the variable "clientname" set and my script is running good!
|
Top
|
|
|
|
#204452 - 2012-03-13 11:45 AM
Re: kix with 2008r2 terminalserver + %clientname%
[Re: Lonkero]
|
hama007
Fresh Scripter
Registered: 2008-05-13
Posts: 5
|
the problem is the same!!!
any idee?
in the kix file i do this
$client = %clientname%
in windows 2003 it runs in windows 2008 r2 not
Edited by hama007 (2012-03-13 11:54 AM)
|
Top
|
|
|
|
#204455 - 2012-03-14 08:32 AM
Re: kix with 2008r2 terminalserver + %clientname%
[Re: Lonkero]
|
hama007
Fresh Scripter
Registered: 2008-05-13
Posts: 5
|
@hostname = name of my terminalserver, i need the name of the client from the user
|
Top
|
|
|
|
#204456 - 2012-03-14 11:15 AM
Re: kix with 2008r2 terminalserver + %clientname%
[Re: hama007]
|
BradV
Seasoned Scripter
Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
|
OK, how about %computername%? If you have MS office installed, read HKCU\Software\Microsoft\Office\12.0\Outlook\Machine Name I also found HKCU\Software\Microsoft\Windows\ShellNoRoam\(Default) and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Distinguished-Name or HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName There are many more. I don't have a citrix setup, so I can't really search for any specific entries relative to that.
|
Top
|
|
|
|
#204490 - 2012-03-16 03:24 PM
Re: kix with 2008r2 terminalserver + %clientname%
[Re: Glenn Barnas]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
Sometimes I wonder what my eyes are seeing I just looked again, and don't see what I thought made it recursive. WTH? Old age?
Please do the "hard work" Glenn... it has to be easier than me doing it and asking someone/you to test it.
|
Top
|
|
|
|
#204608 - 2012-03-29 08:40 PM
Re: kix with 2008r2 terminalserver + %clientname%
[Re: Lonkero]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
Okay so if I read the comments right, I think I have included the changes...
Someone want to test this?
function ClientName()
select
case len(%clientname%)
$clientname=%clientname%
case InStr(@PRODUCTTYPE,"Server 2008")
Dim $s_sessionid, $iIndex, $sessionid
$s_sessionid = SubStr(%TEMP%,1+InStrRev(%TEMP%,"\"))
While $s_sessionid <> ""
$iIndex = InStr("0123456789ABCDEF",Left($s_sessionid,1))
If $iIndex
$SessionID = $GetSessionID*16+(Cint($iIndex-1))
$s_sessionid = SubStr($s_sessionid,2)
Else
$SessionID = 0
$s_sessionid = ""
EndIf
Loop
$ClientName = ReadValue("HKCU\Volatile Environment\" + $sessionid,"CLIENTNAME")
case InStr(@PRODUCTTYPE,"Server 2003")
$ClientName = ReadValue("HKCU\Volatile Environment","CLIENTNAME")
case 1
$ClientName = @WKSTA
endselect
endfunction
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|