I'm getting an error on line 28 of the script referencing the log location in private/var
Script exit code: 1
Script result: + exec /Library/Application Support/JAMF/tmp/KIBSDRDP_Connection2.sh: line 28: /private/var/inte/logs/rdcPlist.txt: No such file or directory
Do I need to create that location in private var first?
I realized that the path you were saving logs to is specific to your environment. I went ahead and added a line to the script to create a differently named folder under private/var for our district to use. After that i was able to get past the error and the script appears to complete successfully. I'm still not seeing any connections under " My Desktops".
still troubleshooting here
So i have examined the plist many times now....Right after deployment it looks formatted properly with a unique UUID and each bookmark line looks good; yet it never shows up as a connection in MS RDP. If i manually make a connection from within MS RDP, and then view the plist file the one that i just created is pretty different. If i then go and delete the connection from the GUI, and reopen the plist file the format of the connection i tried to deploy is all wonky. I may just have to manually set the connections since this doesn't seem as easy as i was hoping.
Here is a copy of what the plist looks like right after deploying the connection
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bookmarkorder.ids</key>
<array>
<string>{97531981-CA4B-4E88-8028-A14F1CFD9A29}</string>
</array>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.depth</key>
<integer>32</integer>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.fullscreen</key>
<false/>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.hostname</key>
<string>KIBSDRDP.kibsd.org</string>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.label</key>
<string>Virtual Psych Scoring Server</string>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.resolution</key>
<string>@Size(1280 1024)</string>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.scaling</key>
<false/>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.useallmonitors</key>
<true/>
<key>bookmarks.bookmark.{97531981-CA4B-4E88-8028-A14F1CFD9A29}.username</key>
<string>kibsdcomposer</string>
</dict>
</plist>
And this is what the plist looks like after I manually create a connection....it looks like something gets jumbled up
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSNavLastRootDirectory</key>
<string>~/Desktop</string>
<key>NSNavPanelExpandedSizeForOpenMode</key>
<string>{712, 448}</string>
<key>NSWindow Frame NSNavPanelAutosaveName</key>
<string>284 247 712 470 0 0 1280 778 </string>
<key>QtLibrarySettings.Qt.filedialog</key>
<data>
AAAAvgAAAAMAAAAeAAAA/wAAAAAAAAACAAAAaAAADgABAAAABwEAAAABAAAAAgAAAAVm
aWxlOgAAAERmaWxlOi8vL1VzZXJzL0NvbXBvc2VyL0xpYnJhcnkvQ29udGFpbmVycy9j
b20ubWljcm9zb2Z0LnJkYy5tYWMvRGF0YQAAAAIAAAB6AC8AVQBzAGUAcgBzAC8AQwBv
AG0AcABvAHMAZQByAC8ATABpAGIAcgBhAHIAeQAvAEMAbwBuAHQAYQBpAG4AZQByAHMA
LwBjAG8AbQAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AcgBkAGMALgBtAGEAYwAvAEQAYQB0
AGEAAAAuAC8AVQBzAGUAcgBzAC8AQwBvAG0AcABvAHMAZQByAC8ARABlAHMAawB0AG8A
cAAAAC4ALwBVAHMAZQByAHMALwBDAG8AbQBwAG8AcwBlAHIALwBEAGUAcwBrAHQAbwBw
AAAAfgAAAP8AAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAIEAAAABAEB
AAAAAAAAAAAAAAAAAABk/////wAAAIEAAAAAAAAABAAAAQQAAAABAAAAAAAAAEIAAAAB
AAAAAAAAAEQAAAABAAAAAAAAAHoAAAABAAAAAAAAAAE=
</data>
<key>bookmarklist.expansionStates</key>
<dict>
<key>GENEREAL</key>
<true/>
</dict>
<key>bookmarkorder.ids</key>
<array>
<string>{c27f3b46-eb8b-46aa-8b11-4423cc22f4ae}</string>
</array>
<key>bookmarks.bookmark.{c27f3b46-eb8b-46aa-8b11-4423cc22f4ae}.fullscreenMode</key>
string>@Variant(???????FullscreenMode?????)</string
<key>bookmarks.bookmark.{c27f3b46-eb8b-46aa-8b11-4423cc22f4ae}.hostname</key>
<string>THIS IS A TEST CONNECTION FROM THE GUI</string>
<key>bookmarks.bookmark.{c27f3b46-eb8b-46aa-8b11-4423cc22f4ae}.label</key>
<string>THIS IS A TEST CONNECTION FROM THE GUI</string>
<key>bookmarks.bookmark.{c27f3b46-eb8b-46aa-8b11-4423cc22f4ae}.username</key>
<string>THIS IS A TEST CONNECTION FROM THE GUI</string>
<key>connectWindow.geometry</key>
<data>
AdnQywABAAAAAAHx////0QAAA/YAAAJvAAAB8QAAACwAAAP2AAACbwAAAAAAAA==
</data>
<key>connectWindow.windowState</key>
<data>
AAAA/wAAAAD9AAAAAAAAAgYAAAJEAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEA
AAAOAHQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAA==
</data>
<key>internal.exportoptionsdialogexportFilename</key>
<string>KIBSD Psych Virtual Scoring Server</string>
<key>preferences.adalmohoro.username</key>
<string></string>
<key>preferences.rdweb.feedurl</key>
string>@Variant(????ÿÿÿÿ)</string
<key>preferences.rdweb.username</key>
<string></string>
<key>preferences.resolutions</key>
<array>
<string>@Size(640 480)</string>
<string>@Size(800 600)</string>
<string>@Size(1024 768)</string>
<string>@Size(1280 720)</string>
<string>@Size(1280 1024)</string>
<string>@Size(1600 900)</string>
<string>@Size(1920 1080)</string>
<string>@Size(1920 1200)</string>
</array>
<key>show_whats_new_dialog</key>
<false/>
<key>stored_version_number</key>
<string>8.0.24875</string>
</dict>
</plist>
@spowell01 any time I had a bookmark that was not showing up, it came down to an ownership issue on the plist. Make sure that the entire container structure has the correct ownership (user:staff).
The plist created by Remote Desktop is a binary plist, so you need to use plutil to convert it to XML if you want to read it or post it:
plutil -convert xml1 <plist>
The plist you posted looks correct.
@stevewood
Thanks for your responses steve, I was able to copy the text from the plist over to my windows machine and as you can see above it let me post it without issue.
It looks to me like once I create a connection manually, the uuid is no longer tied to each string on my original connection?
The UUID is individual to each bookmark you create. So, if you create it using the script you'll have one UUID, and then if you create manually in RDC, you'll have a different UUID for that connection. Make sense?
If you open a Terminal window and go to this path: /Users/<user>/Library/Containers and do an ls -la on that directory, what are the owner/group and permissions for com.microsoft.rdc.mac?
drwx---rwx 5 composer staff 170 Jun 18 16:56 com.microsoft.rdc.mac
composer is the username on this machine currently.
I understand that the UUID is individual, after deployment with the script, the UUID i am seeing for my custom connection is:97531981-CA4B-4E88-8028-A14F1CFD9A29; however it never shows up in the guy
After creating a second connection via the gui i am seeing the uuid for my original connection disappear, and only seeing a uuid for the new connection. The act of creating a new connection in the gui shouldn't wipeout the uuid from my first connection.
so... our users here use the old 2.1.3 version of Remote Desktop Connection.app. I'd love to deploy v8 as it is way more stable when connecting to Win 7 computers... but need an automated way to set up the connection they already have. @stevewood][/url, it looks like your script could possibly do this if I read the hostname in from the old rdc plist.
Any ideas on how to automate accepting the machine cert on a new connection using to Windows 7?
EDIT:
Or rather, pre-populating the cert and putting it in the users keychain? Probably not, but it never hurts to ask!
I've played around a bit more with the connection script this morning and i had one successful run where i installed just the RDP app, and then in a second policy ran the script and voila i saw the connection on the client. I can't reproduce that though, and everything else i try ends up with the plist looking correct with nothing showing up, until i manually create a connection then the plist/bookmark line format changes completely.
And i've finally got it working. I believe it was related to the fact that the plist file was replacing itself with a cached version after i updated it. Looking back i knew of this issue as we had to use killall cfprefsd when modifying plists before. I discovered that simply doing a defaults read on the plist right after updating it essentially does the same thing as killall cfprefsd.
Here is the final script that i'm using and it seems to work pretty flawlessly to add a new connection without wiping out what the users already had in their list. Thanks @stevewood for all your help!
#!/bin/sh
# date: 18 Jun 2014
# Name: RDC-Connection.sh
# Author: Steve Wood (swood@integer.com)
# Modified by Sam Powell (spowell01@kibsd.org)
#This will create a log folder @ /private/var
mkdir /private/var/logs/
# grab the logged in user's name
loggedInUser=/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'
# global
RDCPLIST=/Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist
myUUID=uuidgen
LOGPATH='/private/var/logs'
# set variables
connectionName="Virtual Psych Scoring Server"
hostAddress="10.11.1.158"
# if you need to put an AD domain name, put it in the userName variable, otherwise leave blank
userName='kibsd'
userName+=$loggedInUser
set -xv; exec 1> $LOGPATH/rdcPlist.txt 2>&1
defaults write $RDCPLIST bookmarkorder.ids -array-add "'{$myUUID}'"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.label -string "$connectionName"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.hostname -string $hostAddress
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.username -string $userName
sudo chown -R "$loggedInUser:staff" /Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac
sudo chmod -R 777 /Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac
sudo -u $loggedInUser defaults read /Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist
@stevewood thanks for the script.
Has anyone added the "alternate shell:s": key to Steve's script? I can't figure out the correct syntax.
The key is supported as per https://technet.microsoft.com/en-us/library/dn690096.aspx
userName='domain'
userName+=$loggedInUser
resolution="0 0"
colorDepth="32"
fullScreen="false"
scaleWindow="true"
useAllMonitors="true"
# When I manually add this to the profile it works: alternate shell:s:||WordPad
application="||WordPad"
defaults write $RDCPLIST bookmarkorder.ids -array-add "'{$myUUID}'"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.label -string "$connectionName"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.hostname -string $hostAddress
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.username -string $userName
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.resolution -string "@Size($resolution)"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.depth -integer $colorDepth
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.fullscreen -bool $fullScreen
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.scaling -bool $scaleWindow
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.useallmonitors -bool $useAllMonitors
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.alternateshell -string $application
@gmarnin after some testing, here's what I've come up with that seems to work. Test it, of course.
#!/bin/sh
# date: 18 Jun 2014
# Name: RDC-Connection.sh
# Author: Steve Wood (swood@integer.com)
# updated: 29 Feb 2016 - included line to add remote program to start on connection for @gmarnin
# grab the logged in user's name
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
# global
RDCPLIST=/Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac/Data/Library/Preferences/com.microsoft.rdc.mac.plist
myUUID=`uuidgen`
LOGPATH='/private/var/inte/logs'
# set variables
connectionName="NAME YOUR CONNECTION"
hostAddress="SERVERIPADDRESS"
# if you need to put an AD domain name, put it in the userName variable, otherwise leave blank
userName='DOMAINNAME'
userName+=$loggedInUser
resolution="1280 1024"
colorDepth="32"
fullScreen="FALSE"
scaleWindow="FALSE"
useAllMonitors="TRUE"
set -xv; exec 1> $LOGPATH/rdcPlist.txt 2>&1
defaults write $RDCPLIST bookmarkorder.ids -array-add "'{$myUUID}'"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.label -string "$connectionName"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.hostname -string $hostAddress
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.username -string $userName
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.resolution -string "@Size($resolution)"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.depth -integer $colorDepth
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.fullscreen -bool $fullScreen
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.scaling -bool $scaleWindow
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.useallmonitors -bool $useAllMonitors
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.remoteProgram -string "C:\\\\Program Files\\\\\\\\Windows NT\\\\Accessories\\\\wordpad.exe"
chown -R "$loggedInUser:staff" /Users/$loggedInUser/Library/Containers/com.microsoft.rdc.mac
@stevewood Good work!
I'd chuck a defaults read on the end so CFPrefsD
[@stevewood](@stevewood)
You put me on the right path. Thanks!
I used:
application="C:Program FilesWindows NTAccessorieswordpad.exe"
defaults write $RDCPLIST bookmarks.bookmark.{$myUUID}.remoteProgram -string "$application"
I'm getting ready to start using VPP for a couple Mac Store Apps. I'm starting with Microsoft Remote Desktop 8.0.31. I downloaded ("purchased") 300 copies from the VPP web store, but I cant seem to manage/deploy them.
I noticed that Microsoft Remote Desktop 8.0.31 is labled as "Device-Assignable". Does that mean it can be managed on a per-computer basis from JAMF without end-user interaction and without hacking the _MASReceipt folder?
I dont see many VPP options compared to what is articulated in the JAMF Admin Guide, but I do have VPP set up with a valid account, and its plugged-into the JSS properly from what I can tell.
Still on JAMF 9.81.



@dstranathan your Microsoft Remote Desktop should have a VPP tab like you see for my Pages example. I'm on 9.82 by the way.

Thank you @mpermann
No VPP tab here. Clearly missing something. Other than that, it looks like Im set up with VPP correctly. Any thoughts on what could be misconfigured on my end?
@dstranathan does your Gear -> Global Management -> VPP Accounts have a VPP account listed? Mine does and you should as well. It should look similar to what I have pictured below. I've edited out some of the particulars for privacy reasons.


@mpermann Yup - I set up VPP back in November with my JumpStart engineer. The back-end config/account looks good to me.


I've never tried sites so it could be nothing, but "Site to add the account to: None" looks ominous.
I believe "Site" is for DEP-related stuff, which Im not using (yet). JAMF (and my JumpStart dude) support suggested that I not bother with Site-related stuff at this time.
@dstranathan I don't have any sites setup so I don't have the Site drop down like you do. Not sure why that would cause your problem, but it might be worth looking at. It's also possible that you haven't met all the requirements for VPP managed distribution. You may want to consult the documentation as there are some specific things that must be in place before VPP managed distribution will work for Macs. Maybe you are missing one of them.