Microsoft Remote Desktop 10 Bookmarks

khuong_lai
New Contributor II

Hi Guys,

I've been trying to add remote desktop bookmarks from https://soundmacguy.wordpress.com/2020/06/14/managing-microsoft-remote-desktop-10-bookmarks-with-han... and when i run the script i get this error below

 

Executing Policy Add Remote Desktop H&L
Running script msrd10-add-remotedesktop...
Script exit code: 132
Script result: User: staff is logged in...
Username specified, Creating bookmark for: sysnet Domain not specified, username will not be prefixed... Creating bookmark: H&L /Library/Application Support/JAMF/tmp/msrd10-add-remotedesktop: line 98: 7252 Illegal instruction: 4 sudo -u "${loggedInUser}" "${msrd}" --script bookmark write $(uuidgen) --hostname "${hostname}" --friendlyname "${friendlyname}" --resolution "${resolution}" --group "${group}" --username "${username}" ${extraArgs} 2> /dev/null

Error running script: return code was 132.

 

But if i run sudo jamf policy when i'm in Terminal on the computer the policy executes fine.  Anyone able to chime in and help me out?  Thanks!

1 REPLY 1

junjishimazaki
Valued Contributor

Hi this is my script to add Microsoft RDP connections.

#!/bin/sh

#Pass argument in policy

hostaAdress=$4
friendlyName=$5

# get the cli executable
cli="/Applications/Microsoft Remote Desktop.app/Contents/MacOS/Microsoft Remote Desktop"

LOGPATH='/private/tmp'

# grab the logged in username
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

# global settings
myUUID=`uuidgen`

# variable settings
remoteappprogram="/Applications/Microsoft Remote Desktop.app "

# deploy the above variables
sudo -u $loggedInUser "$cli" --script bookmark write "$myUUID" --hostname "$hostAddress" \
--friendlyname "$friendlyName" \
--redirectprinters true \
--username "$loggedInUser"

exit 0