Not the exact same thing, but here is some code I had from around April 2004
Makes changes to the actual Terminal Server

Here is a link to a site dedicated to Microsoft Terminal Server if wanted
http://www.msterminalservices.org/


 Code:
If Not @LogonMode
  Break On
Else
  Break Off
EndIf
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')

Dim $System, $Systems
$Systems = 'TERMSERVER01','TERMSERVER02','TERMSERVER03','TERMSERVER04'
For each $System in $Systems
  If $System
  	ResetTerminalServerSettings($System)
  EndIf
Next

Function ResetTerminalServerSettings(optional $System)
Dim $Key,$SetfInheritResetBroken,$SetfInheritMaxSessionTime,$SetfInheritMaxDisconnectionTime,
    $SetfInheritMaxIdleTime,$SetfResetBroken,$SetMaxDisconnectionTime,$SetMaxIdleTime,
    $SetMaxConnectionTime,$Remote
  $Remote = Join(Split($System, '\'), '', 3)
  $Remote = IIf($Remote <> '', '\\' + $Remote + '\', $Remote)
  $Key = 'HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'
  $SetfInheritResetBroken          = WriteValue($Remote + $Key,'fInheritResetBroken',0,'REG_DWORD')
  $SetfInheritMaxSessionTime       = WriteValue($Remote + $Key,'fInheritMaxSessionTime',0,'REG_DWORD')
  $SetfInheritMaxDisconnectionTime = WriteValue($Remote + $Key,'fInheritMaxDisconnectionTime',0,'REG_DWORD')
  $SetfInheritMaxIdleTime          = WriteValue($Remote + $Key,'fInheritMaxIdleTime',0,'REG_DWORD')
  $SetfResetBroken                 = WriteValue($Remote + $Key,'fResetBroken',1,'REG_DWORD')
  $SetMaxConnectionTime            = WriteValue($Remote + $Key,'MaxConnectionTime',0,'REG_DWORD')
  $SetMaxDisconnectionTime         = WriteValue($Remote + $Key,'MaxDisconnectionTime',60000,'REG_DWORD')
  $SetMaxIdleTime                  = WriteValue($Remote + $Key,'MaxIdleTime',1800000,'REG_DWORD')
EndFunction