Posted on 08-30-2017 01:58 PM
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...
Posted on 08-30-2017 03:06 PM
Try
su - $logged_in_user -I -F /tmp/ml0154927_ILA.mobileconfig
Posted on 09-04-2017 10:12 PM
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