Brian Madden Logo
Your independent source for application and desktop virtualization.
Marketplace

advertisement

Script for disconnected sessions, in the Scripting / Automation forum on BrianMadden.com

rated by 0 users
This post has 4 Replies | 0 Followers

Guest Posted: 10-07-2005 8:10 AM
Hi,

Is it possible to write a script or something else to set the disconnected session time on the ICA listener?
further than that It will be also nice to set the Idle timeout and the action on a broken or timed-out connection.

I have a farm with a lot of servers and want to change these settings.

  • | Post Points: 20
Top 10 Contributor
Points 20,562
Yes, you can script this. It is set in the registry. Look under HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-tcp

Rudy

  • | Post Points: 35
Not Ranked
Points 45
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-tcp


OK thank you. I tried to find these myself but overlooked this key.

This is what I was looking for. I can create the script now.
  • | Post Points: 5
Not Ranked
Points 45
My 2cts. The script I wrote for configuring the Timeout values.
btw I am not a programmer.

'----------------------------------------------------------------------------
' The following script Sets Timeout settings for ICA listener in Registry.
' ---------------------------------------------------------------------------

Dim ResetBroken, ConTimMin, DisconTimMin, IdleTimMin
Dim ConTimmsec, ConTimHex
Dim DisconTimMsec, DisconTimHex
Dim IdleTimMsec, IdleTimHex
Dim WSHShell, strKey ,strVal, RegLoc, KeyValList, Setting
Set WSHShell = WScript.CreateObject("WScript.Shell")

' **** Values for timeout settings ***
ResetBroken=0 ' Value Zero will disconnect timed-out or broken connections. Value One will reset those.
ConTimMin=0 ' Number of minutes for max connected session time. Zero is infinite
DisconTimMin=480 ' Number of minutes for max disconnected session time. Zero is infinite
IdleTimMin=60 ' Number of minutes for max idle session time. Zero is infinite

'Calculations from minutes to milliseconds
ConTimmsec=ConTimMin * 60 * 1000 'Calculate value for registry value max connected session Time
DisconTimMsec=DisconTimMin * 60 * 1000 'Calculate value for registry value max disconnected session Time
IdleTimMsec=IdleTimMin * 60 * 1000 'Calculate value for registry value max idle session time
On Error Resume Next
RegLoc = "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-tcp\"

'Set timeout values
WSHShell.RegWrite RegLoc + "MaxConnectionTime",ConTimmsec,"REG_DWORD"
WSHShell.RegWrite RegLoc + "MaxDisconnectionTime",DisconTimMsec,"REG_DWORD"
WSHShell.RegWrite RegLoc + "MaxIdleTime",IdleTimMsec,"REG_DWORD"
WSHShell.RegWrite RegLoc + "FResetBroken",ResetBroken,"REG_DWORD"

'set inherit user settings off
WSHShell.RegWrite RegLoc + "fInheritMaxSessionTime",0,"REG_DWORD"
WSHShell.RegWrite RegLoc + "fInheritResetBroken",0,"REG_DWORD"
WSHShell.RegWrite RegLoc + "fInheritMaxIdleTime",0,"REG_DWORD"
WSHShell.RegWrite RegLoc + "fInheritMaxDisconnectionTime",0,"REG_DWORD"

WScript.Quit ' Tells the script to stop and exit.

  • | Post Points: 5
Not Ranked
Points 25
Hey Rudy,
I was wondering there are all these nice features to disconnect ICA-TCP. How about a script on how to enable ICA-TCP on PS 4.0. Thanks!!

Vito

  • | Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright © 1997-2008 The Brian Madden Company, LLC | Disclosures | Privacy | Terms of Use | Contact Info