Skip to main content
Question

Installing user level profile with PKG (No APNs enabled in our environment)


rqomsiya
Forum|alt.badge.img+12

Hi all,

I'm trying to deploy user level configuraiton profiles, but the below script doesn't seem to be working.. any ideas?

#!/bin/bash

logged_in_user=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`

echo $logged_in_user

/usr/bin/profiles -I -U $logged_in_user -F /tmp/ml0154927_ILA.mobileconfig

exit 0

If i manually double click and install the profile when the user is logged in, it works fine, however it prompts for admin creds, which none of these users are granted. The issue is i need to push out roughly 50 of these and want zero user interaction or interaction from the help desk to enter the admin creds...

2 replies

Forum|alt.badge.img+8
  • Contributor
  • 41 replies
  • August 30, 2017

Try

su - $logged_in_user -I -F /tmp/ml0154927_ILA.mobileconfig

rqomsiya
Forum|alt.badge.img+12
  • Author
  • Honored Contributor
  • 225 replies
  • September 5, 2017

No go.. tried that and got this error when i ran the scipt via terminal as root:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/usr/bin/profiles: /usr/bin/profiles: cannot execute binary file

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