1. Viewing and Manipulating the Install Mode with change user
The best way to install applications on an RDS
Session Host or Terminal Services server is with Microsoft Installer
(.msi) files. When you use .msi files, you don’t need to take any
additional steps. However, if you install an application that doesn’t
use an .msi file, you need to take additional steps with the change user command. The basic syntax is
change user /execute | /install | /query
Tip
The chgusr command is an alias for change user. In other words, you can use chgusr with any of these switches just as you use change user with these switches.
change user Commands | Comments |
---|
Prepare to install applications.
| Enables
install mode. When in install mode, you can then install applications
and the RDS Session Host server or Terminal Services server records the
process. |
Return system to execute mode.
| Enables execute mode. After installing the application, this command returns the server to execute mode. |
Identify current mode.
| Displays current settings.
If the system is in execute mode, it indicates “Application EXECUTE mode is enabled.”
If the system is in install mode, it indicates “Application INSTALL mode is enabled.” |
If you need to install an application that isn’t using Microsoft Installer, perform the steps in the following order:
Steps | Action |
---|
1. | Run change user /install from the command prompt. |
2. | Install the application. |
3. | Run change user /execute from the command prompt. |
2. Modifying Logon Capabilities with change logon
You can enable and disable client logons to RDS or TS servers with the change logon command.
change logon Commands | Comments |
---|
Disable logons.
C:\>change logon /disable
| You can use this to prevent new users from logging on without affecting the users who are currently logged on.
Note
Logons are automatically reenabled when the system is restarted.
|
Enable logons.
| Reenables user logons after they have been disabled. |
Identify current mode.
| Displays the current session logon status. |
| Disables new user logons but allows reconnections to existing sessions. |
C:\>change logon /drainuntilrestart
| Disables new user logons until the server is restarted but allows reconnections to existing sessions. |
Tip
These settings affect
administrator sessions also. In other words, if you disable logons and
then log off, you will not be able to log on to the administrator
session until logons are reenabled.
3. Connecting and Disconnecting Sessions with tscon and tsdiscon
You can use the tscon and tsdiscon commands to connect and disconnect RDS and TS sessions. The tscon command connects a user to a session running on an RDS or TS server. The tsdiscon disconnects a user from a session.
The basic syntax of tsdiscon is
tsdiscon sessionid | sessionname
For example, consider Figure 1
showing Terminal Services Manager on a Windows Server 2008 server. It
shows a single session open with a session ID of 2 and a session name of
RDP-Tcp#0.
You can disconnect this session with either of the following commands:
tsdiscon 2
tsdiscon rdp-tcp#0
Similarly, if the session is disconnected, you can connect it with the tscon command. The basic syntax of tscon is
tsdiscon sessionid | sessionname
You can connect the session with either of the following commands: