Importing Windows Azure Virtual Machines into Remote Desktop Connection Manager (RDC Man)

UPDATE: See here for an updated version for RDC Man 2.7 that adds support for PaaS instances.

After my last post I started thinking about the fact that you could use PowerShell to retrieve the server name and port information. From there it was a short step to automatically creating a configuration file for Remote Desktop Connection Manager that contains all of the Virtual Machines for an Azure subscription.

Set up the Windows Azure PowerShell cmdlets

I’m assuming that you already have Remote Desktop Connection Manager, but if not you’d better get that now.

If you haven’t already installed the Windows Azure PowerShell cmdlets (really? why not?) then go and grab them from the Script Center, just click on the Download box.

Once you have installed the cmdlets you need to configure them to use your subscription. In PowerShell execute Get-AzurePublishSettingsFile. This will launch a browser, prompt to to sign in (if you’re not already signed in) and then download you publish settings file. Save this somewhere easy to get to. Next, run Import-AzurePublishSettingsFile PathToYourSavedFile.publishsettings

If you have multiple subscriptions then you can use Select-AzureSubscription to choose which subscription to work with (Get-AzureSubscription will list them).

At this point, you should be able to run Get-AzureService and see the services for your subscription.

For a more detailed walkthrough, see How to install and configure Windows Azure PowerShell

Run the script

Grab the script from https://gist.github.com/stuartleeks/8436568

Run it from the PowerShell window where you imported the Azure publish settings.

That’s it! You should now have a file called AzireVMs.rdg in your current directory. Open that in Remote Desktop Connection Manager and you’re good to go.