RDP – Remote Desktop Connection, or what we called back in the day, Terminal Services. Every system administrator uses it daily. At work, the team I work on has 145 servers that we are responsible for, and only a handful of them are in the same building as us (although we still remote into them as well).
This being said, I was getting tired of typing in the server’s name or IP address every time I needed to connect to it. I know Microsoft has an mmc for Remote Desktops, but I just don’t like the clunky way it has to be setup, plus, did I mention I had 145 to put in? Well, call me lazy, but I knew there had to be a way to script it – after all, a RDP file is nothing but some text (open a .rdp file with notepad – you’ll see!).
So, enough background, lets do some scripting! There are 3 files here: Powershell script, a CSV file, and a Text file.
- First, the CSV File: It has 4 columns with the first row being the headers. Do not change row. Name this file RDPLIST.csv
- Next, is the Text File. This contains other parameters that are going to be the same between every connection – such as enabling shared clipboard, 16bit colors, disable themes, etc. You can customize this to your liking (to get it just the way you want it, create an .rdp file, and edit it with notepad, and you will see a list similar to below). Name this file template_bottom.txt
- Lastly, the Powershell script: Name this file CreateRDP.ps1
Now, you need a folder structure:
Put all three files in the _script folder.
And just because I’m a nice guy, here’s a zip of the files and the correct folder structure. Just unzip, make your edits to the csv file, save and close it, and open PowerShell (as Administrator if using Vista) and navigate to the _Script folder. Once there, run the CreateRDP.ps1 (put a ./ in front of the filename)
Feel free to customize this script to your own liking! It’s a simple script, so it shouldn’t be too hard to mess with. It works like a CHARM!!! I created 290 RDP files in less than 30 seconds! Great thing is, it creates a separate folder structure for the different resolutions (I used 1024×768 & 1152×864 because my laptop is a widescreen, but when I’m docked, it’s a standard monitor).
One more tip, I made two new toolbars, and pushed them all the way over to the right of the taskbar, making a nifty little launcher!
Hope you enjoy this – I know I did! It took me longer to write this post than it did to get all my .RDP files!
[ UPDATE: Original Script was written by Aaron Dodd, just tweaked by me]