Sean's Personal Code Samples And References
Tscon.exe

Tscon.exe attaches a user session to a previously connected Terminal Server session.

Syntax for Tscon.exe:
TSCON [sessionid | sessionname] [/SERVER:servername] [/DEST:sessionname]
        [/PASSWORD:pw] [/V]

  sessionid          The ID of the session.
  sessionname        The name of the session.
  /SERVER:servername The name of the Terminal Server to connect to (default is current).
  /DEST:sessionname  Connect the session to destination sessionname.
  /PASSWORD:pw       Password of user owning identified session.
  /v                 Displays information about the actions performed.

  Example: tscon 3 /server:cprsrv02 /dest:rdp-tcp#3 /password:* /v
				
Tsdiscon.exe

Tsdiscon.exe disconnects an active Terminal Server session.

Syntax for Tsdiscon.exe:
TSDISCON [sessionid | sessionname] [/SERVER:servername] [/V]

  sessionid           The ID of the session.
  sessionname         The name of the session.
  /SERVER:servername  Specifies the Terminal Server (default is current).
  /v                  Displays information about the actions performed.

  Example: tsdiscon 3 /server:cprsrv02 /v
				
Tsshutdn.exe

Tsshutdn.exe shuts down a Terminal Server in a controlled manner.

Syntax for Tsshutdn.exe:
TSSHUTDN [wait_time] [/SERVER:servername] [/REBOOT] [/POWERDOWN]
         [/DELAY:logoffdelay] [/V]

  wait_time           Seconds to wait after user notification before
                      terminating all user sessions (default is 60).
  /SERVER:servername  The server to shut down (default is current).
  /REBOOT             Reboot the server after user sessions are terminated.
  /POWERDOWN          The server prepares for powering off.
  /DELAY:logoffdelay  Seconds to wait after logging off all connected
                      sessions (default is 30).
  /v                  Display information about actions being performed.

  Example: tsshutdn 60 /server:cprsrv02 /reboot /delay:30 /v
				
Tskill.exe

Tskill.exe ends an active process and/or processes on a selected server.

Syntax for Tskill.exe:
TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A] [/V]

  processid           Process ID for the process to be terminated.
  processname         Process name to be terminated.
  /SERVER:servername  Server containing processID (default is current).
                         /ID or /A must be specified when using processname
                         and /SERVER
  /ID:sessionid       End process running under the specified session.
  /a                  End process running under all sessions.
  /v                  Display information about actions being performed.

  Example: tskill 172 /server:cprsrv02 /id:3 /v
				
Rwinsta.exe

Rwinsta.exe resets the session subsystem hardware and software to known initial values.

Syntax for Rwinsta.exe:
RESET SESSION {sessionname | sessionid} [/SERVER:servername] [/V]

  sessionname         Identifies the session with name sessionname.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server containing the session (default is current).
  /v                  Display additional information.

  Example: rwinsta 3 /server:cprsrv02 /v
	
Sean Marcellus
There are 10 kinds of people e in this world, those who understand binary and those who don’t.