Windows – using Terminal Services from command line
Posted by decipherinfosys on March 2, 2009
Almost everyone who has worked on windows for some time has used Terminal Services and Terminal Services Manager at some time in their work. Instead of always using the GUI in order to terminal serve into machines, one can create rdp extension files in order to store that information or one can also make use of the command line in order to make those connections. In this post, we will show how to do both.
The command to invoke the terminal services connection is by using mstsc (Microsoft Terminal Services Commands) from the command prompt. So, Start/Run and type: cmd and then enter. On the command prompt, enter: mstsc /? and you will get this help menu:
All the options are pretty much self explanatory. The most useful ones that we have found are the connection file, console and the /v:<server[:port]> options.
Let’s look at how we can create a *.rdp extension file that we can use with this command. This time, just enter mstsc and press enter and you will get the remote desktop connection screen:
You can click on options and then you will see the options of saving the connection settings as an rdp extension file. But before we do that, ensure that you have the rest of the options set up properly. The second tab will allow you to set up the display properties for the terminal services window, the Local Resources tab is something that we have used quite often – you can share your local resources like disk drives (available after clicking on the more button), printers, clipboard with your remote session:
Once you have made all the necessary changes, you can then go back to the General tab and click on Edit to edit the credentials that are needed for connectivity for that RDP file or you can choose to always prompt for credentials. The advantage of having the RDP files is to ensure that everyone uses the same settings and the files can be shared across team members. Using the command line also allows more flexibility by making use of options like /admin or /console etc.
- Download Remote Desktop Connection for Windows XP x64 Edition – here.
- Technet Performance Team blog post – here. It explains that as of Vista SP1 and Windows 2008 also, the /console switch no longer gets you to the console session – you need to use the /admin switch instead. Shijaz Abdulla has also covered this in his post here.