3. Connecting to Remote Systems with mstsc
You can launch the Remote Desktop Connection from the command line with the mstsc command, which is short for Microsoft Terminal Services Connection. You can enter it from the command prompt or from the Start Search box after clicking Start.
Tip
Microsoft renamed Terminal Services to Remote Desktop Services in Windows Server 2008 R2; however, commands such as mstsc still work. In other words, the acronym has not been renamed from mstsc to msrdsc.
Figure 1 shows the Remote Desktop Connection tool after clicking Options. You can also access this by clicking Start, All Programs, Accessories, Remote Desktop Connection.
At this point, you can enter the computer name and click Connect. You are prompted to enter the credentials of a user that has permission to log on remotely.
Note
You can configure the settings you want for the connection in any of the tabs, and then click Save As to save the settings as an .rdp configuration file. You can then use this file to connect.
The following table shows some of the switches you can use with mstsc.
mstsc Switch | Description |
---|
Use a connection file.
mstsc file path and name
c:\>mstsc c:\data\dc1.rdp
| If you have an .rdp file that includes the connection information, you can use it with the mstsc. You won’t need to reconfigure all the settings each time you connect to a server. |
/v:server[:port]
c:\>mstsc /v:dc1
c:\>mstsc /v:dc1:6789
| The /v
switch enables you to specify which server to connect to and specify
the port.
The default port is 3389 but it can be changed. For example, if the port
was changed to 6789 on the server, you can use the example command. |
/admin
c:\>mstsc /admin /v:dc1
| Connects
to one of the two administrator sessions. This is the default as long
as the remote server is not running Remote Desktop Services as a Session
Host server. In other words, as long as the remote server is not
hosting RDS desktops or applications, the /admin switch is not needed.
Note
Microsoft recommends using this instead of the /console switch to connect to Windows Server 2003 servers.
|
/console
c:\>mstsc /console
The preferred method is
| This
was used to connect to the console session for Windows Server 2003
computers. However, it has been deprecated and can cause errors in
certain situations, so it should be replaced with the /admin switch. It is ignored when connecting to a Windows Server 2008 or Windows Server 2008 R2 server. |
| Connects in full-screen mode. |
/w:number
mstsc /w:number
c:\>mstsc /w:800 /v:dc1
| Specifies the width of the screen in pixels. This directly affects the displayed resolution. |
/h:number
mstsc /h: number
c:\>mstsc /h:600 /w:800 /v:dc1
| Specifies the height of the screen in pixels. This directly affects the displayed resolution.
The example specifies a screen size of 800×600. |
/span
c:\>mstsc /span /v:dc1
| Enables spanning across multiple monitors if the local computer is using multiple monitors.
Matches the remote desktop width and height with the local virtual desktop, |
/multimon
c:\>mstsc /multimon /v:dc1
| Configures the remote desktop session monitor layout to be identical to the current client-side configuration. |
/public
c:\>mstsc /public /v:dc1
| Runs RDC without caching the passwords and bitmaps. |
/edit file path and name
c:\>mstsc /edit c:\data\dc1.rdp
| Opens up the RDC console. You can then edit the settings and save over the original .rdp file by clicking Save.
Tip
The .rdp file is a simple text file. It’s also possible to view and edit the file in Notepad by entering notepad file path and name.
|
Note
Windows Server 2008 and
Windows Server 2008 R2 servers are limited to only two remote
administrator connections at a time. In Windows Server 2003, you can
connect to the console remotely giving you access to three sessions.
However, the console session is not available for remote connectivity in
Windows Server 2008 and Windows Server 2008 R2.