Skip to main content
Question

Is it possible to select a Configuration Profile with Applescript?


Forum|alt.badge.img+8

Hi all,

I am trying to use applescript to select a specific Configuration Profile (MDM Profile) but I am unable to do (can find it how to do this) The reason is for a little help script to have users click the 'Approve' button without looking for the setting.

Any help is appreciated

12 replies

arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • April 29, 2020

I’m not sure if what you are attempting to do exactly is just get them to Profiles in System Preferences or if you’re trying to get them there but also select specifically the MDM profile as well. I use Jamf Helper to popup a message letting them know what is going on and when they click OK on the popup it takes them to Profiles but it wont preselect the MDM profile, since the CA certificate profile is first that will be preselected. Here is the shell script I use. Let me know if its of any help.

#!/bin/bash

consoleuser=`/bin/ls -la /dev/console | /usr/bin/cut -d " " -f 4`

sudo pkill -1 'System Preferences'

/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -title "NameOfMyComapny" -description "Due to new Apple security features you will be required to approve a profile on the following window.  You will only have to approve this profile once.

After clicking OK a window will popup, on this new window click on MDM Profile on the left pane, then click on the Approve button and you will be asked to confirm to Approve once more, click Approve to complete the process." -icon /private/tmp/companylogo.png -button1 "OK" && sudo -u $consoleuser open /System/Library/PreferencePanes/Profiles.prefPane && sleep 120

exit 0

Forum|alt.badge.img+8
  • Author
  • Contributor
  • 118 replies
  • April 29, 2020

Thanks for the reply. I can open the system Preferences and even open Configuration Profiles. But I want to select the MDM Profile (yes my users are not that smart) That's the thing I want to accomplish. the user will only have to press the approve button there..


arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • April 29, 2020

I will dig into this later today in a virtual machine and see if there is any way to get this done. It’s very early here where I am. I will reply to you with my findings. The idea does sound interesting.


Forum|alt.badge.img+4
  • New Contributor
  • 8 replies
  • October 8, 2020

@rblaas @arivera I'm in the same situation; curious to know if a solution was found. Thanks.


arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • October 8, 2020

As far as I’ve tried many things I haven’t found a way to do this unfortunately.


leslie_h
Forum|alt.badge.img+14
  • Employee
  • 100 replies
  • October 9, 2020

Tried this?
https://jerbecause.wordpress.com/2018/02/18/remotely-approving-uamdm/


arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • October 9, 2020

Only one problem. This method will not work on Mojave and above.


leslie_h
Forum|alt.badge.img+14
  • Employee
  • 100 replies
  • October 9, 2020

Technically it still works, but I think the manual effort to enable all the permissions isn't worth it.
Below is a quick video
https://streamable.com/3aaoc8


arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • October 9, 2020

I probably should’ve clarified and not assumed that if you are going to manually set up the issues you are going to run into because of PPPC on Mojave you might as well just click approve yourself.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • 118 replies
  • October 21, 2020

To clarify my question,

It is not about auto approving.. But display the MDM profile. (not just all profiles, but really select the mdm profile so the user can just click approve)


arivera
Forum|alt.badge.img+6
  • Contributor
  • 29 replies
  • October 21, 2020

@rblaas I do understand what you mean, I believe I tried many ways to do this before but never got to it. I get it that you are trying to make it as simple as possible for the users so that there is no excuse or confusion of where they need to go. Hopefully someone can chime in and provide some solution.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • 118 replies
  • October 21, 2020

@arivera thanks :) Although I kinda have given up hope :)

And it is not that bad because most computers are now under DEP .


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