How To: Create a Microsoft Remote Desktop 8 Connection

Standard

On October 18th Microsoft released version 8 of it’s Remote Desktop app via the App Store. Which is great as the older version had been more than buggy & we’ve just started a project which requires users to RDP into VM’s.

Following Rich Troutons excellent steps I managed to download a copy that is App Store account free.

Next steps was to figure out how to deploy connections to this app. Well, that’d be a simple plist in ~/Library/Preferences right? Nope! Remember this is Microsoft (the people whom use a plist in the format of the windows registry…), so off armed with TextWrangler, Composer & steely determination I went about figuring this thing out.

I loaded up Composer & ran “Monitor File System Changes” then preceded to create a connection in Microsoft Remote Desktop. it appears that the path of the plist is indeed not standard & exists in: ~/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist

UPDATE: As per the comments below, it appears for Mac App Store application plists is always in this location

A Quick Look in Finder of the plist showed that at the top there is an array which contains a UUID for each Connection.

Image

This UUID string is then used within each key to differentiate settings between connections.

Image

Luckily enough the UUID seems to be generated using the simple command below & so can easily be scripted using:

uuidgen

From there on it’s pretty straightforward to create a script, below is the GUI with the variable names as per the script which can be found on at the bottom of this post

Image

Examples of variables to pass can be seen in my Casper Remote window below:

Create a Microsoft Remote Desktop 8 Connection

In the above example I have left the UUID field blank, which will create one when the script runs. You could specify your own UUID by generating one via the uuidgen command above & thus give you the ability to easily update a Connections settings down the line.

Once the above is run, the connection should appear My desktops section within the Microsoft Remote Desktop app.

Create a Microsoft Remote Desktop 8 Connection Conections

This now reminds me to Vote Up the following feature request to allow a script to be used multiple times within a policy so this could be used to specify multiple servers, if you agree it’s here.

 

23 thoughts on “How To: Create a Microsoft Remote Desktop 8 Connection

    • Ben Toms

      Didn’t know that path was standard as so far have avoided MAS apps. Do these apps still respect MCX?

  1. Gur Duvilanski

    Did you find a way to deploy the redirection preferences?
    Every way I tried ended with no results, and sharing the home folder for the users to upload files is critical in our environment.

    • Ben Toms

      Hi Gur,

      Sorry for the delay, but I have been making a lot of changes around here.

      Could you send me an example plist setup with the redirection preferences?

    • Ben Toms

      I’m sure it could be scripted, but as we don’t have one I’m not sure how.

      Maybe upload a copy of your plist with the gateway filled out using the contact page?

      I’ll see if I can figure it out when looking @ Gur’s redirection.

        • Ben Toms

          Sorry. I received the file but have not been able to try & recreate yet.

          All day meeting tomorrow, but maybe by end of week.

            • Ben Toms

              Sorry Gur.

              I’m struggling to even get it working via the GUI.

              I’ll reach out to one of my colleagues when i’m back in the office next year.

              • Hi Gur,

                I’ve got this working, but mapping ~/Desktop is not mapping to the remote computers desktop.. instead it can be found under “My Computer.”

                Is that what you’re trying to achieve?

                • Gur Duvilanski

                  Yes, just need the user to be able to use his documents with the remote computer.
                  Does Copying the prefs to another computer works?

                  • Hi Gur,

                    Sorry I’m looking to re-visit the script & re-write it via Python.. I’ll test what you’re looking for when that happens.

  2. Steve Wood

    I’m noticing that I have to convert the plist to binary after creating it in order for it to work properly. Anyone else seeing this behavior?

      • Steve Wood

        Using “plutil” I converted it to binary with this command:

        plutil -convert binary1

        I went a step further and added a spot at the top of the script to check for the plist’s existence and then converted it to XML so that if there were existing bookmarks they would hopefully not be destroyed. So I threw this in right after grabbing the logged in user:

        if [[ -e /Users/”$loggedInUser”/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist ]]; then

        /usr/bin/plutil -convert xml1 /Users/”$loggedInUser”/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist

        fi

        Then at the end, before the chown, I convert back to binary:

        /usr/bin/plutil -convert binary1 /Users/”$loggedInUser”/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist

        Hope that’s clear.

    • Dani Roloson

      … and it would be better to have plistFile defined once in case it changes rather than having it 11 times.

Leave a Reply