|
|
|||||||
Hello, We have a bunch of thin clients and are upgrading our terminal servers from 2003 to 2008 R2. 2008 R2 now creates a subkey named the TS Session ID GetSessionID() is a sweet little UDF by pearly Code: $session = GetSessionID() ? $session $UserSID = "HKEY_USERS\" + @SID $ClientName = @WKSTA If InStr(@PRODUCTTYPE,"Server") and InStr(@PRODUCTTYPE,"2008") $ClientName = ReadValue($UserSID + "\Volatile Environment\" + $Session,"CLIENTNAME") ENDIF If InStr(@PRODUCTTYPE,"Server") and InStr(@PRODUCTTYPE,"2003") $ClientName = ReadValue($UserSID + "\Volatile Environment","CLIENTNAME") ENDIF |
||||||||
|
|
|||||||
Nothing wrong with your code. I like working with functions better so maybe something like this... untested, requires getsessionid() ? clientname() Code: function Clientname() select case InStr(@PRODUCTTYPE,"Server 2008") $ClientName = ReadValue("HKEY_USERS\" + @SID + "\Volatile Environment\" + getsessionid(),"CLIENTNAME") case InStr(@PRODUCTTYPE,"Server 2003") $ClientName = ReadValue("HKEY_USERS\" + @SID + "\Volatile Environment","CLIENTNAME") case 1 $ClientName = @WKSTA endselect endfunction |
||||||||
|
|
|||||||
That function works perfect. Thanks for taking the time to clean it up and reply. Most appreciated. |