Skip to main content
Question

EnableRemoteDesktop API Not Working


Forum|alt.badge.img+5

When I attempt to use the JAMF API to enable Remote Desktop using

/usr/bin/curl --verbose --header 'authorization: Basic XXXXXXXXX' https://XXXXXXX.jamfcloud.com/JSSResource/computercommands/command/EnableRemoteDesktop/id/XXXX
 

I get the following output ... 

Warning: Binary output can mess up your terminal. Use "--output -" to tell Warning: curl to output it to your terminal anyway, or consider "--output Warning: <FILE>" to save to a file.

 

Then if I check System Preferences ... it's not set. Is there another way to get output to see where it's going wrong? I don't want to have to put the username/password in a script, hence using basic auth, but I'm not sure if that's why it's not working. 
 
Any ideas?

2 replies

Forum|alt.badge.img+5
  • New Contributor
  • 34 replies
  • March 21, 2023

It looks like you are just sending a 'curl' rather than sending a POST - https://developer.jamf.com/jamf-pro/reference/createcomputercommandbycommandandid


Bol
Forum|alt.badge.img+11
  • Contributor
  • 276 replies
  • March 25, 2023

As wkelly1 answered, that would be it. Also add in url switch, try the following but tweak for your auth / url settings etc;

/usr/bin/curl --request POST \\
--url "https://XXXXXXX.jamfcloud.com/JSSResource/computercommands/command/EnableRemoteDesktop/id/XXXX \\
--silent \\
--header "Authorization: Bearer $token"

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings