Posted on 10-07-2016 06:24 AM
I'm looking to create a policy based on macs with certain configuration profile that is installed in self service.
I went to make a smart group but can't seem to find a criteria fro profile name like in the mobile smart groups.
Is there any way to do this?
Posted on 10-07-2016 01:20 PM
That criteria is not available for Computers, only iOS device.
We wrote an extension attribute to collect this info that we could then base searches and groups off of.
I know the JSS stores this info but for some reason they do not allow us to use it for anything.
Posted on 10-07-2016 01:46 PM
@martinf you can gather the profiles that are installed with an EA like this.
#!/bin/sh
# Displays all configuration profiles installed
profiles=`profiles -C -v | awk -F: '/attribute: name/{print $NF}'| sort | sed -e 's/^[ ]*//'`
if [[ ! -z "$profiles" ]]; then
echo "<result>$profiles</result>"
else
echo "<result>Not Installed</result>"
fi
exit 0
Smart Groups can be based from that EA.
Posted on 10-09-2016 01:19 AM
Hmm.. is there an FR for being able to scope Smart Groups for Computers based on profiles as per iOS?
Posted on 10-14-2016 05:37 AM
thanks @strider.knh that is exactly what i need and has worked!
Will make a real difference to us - i need to make most of our VPP apps available to all our users but i don't want to have to buy say 100 Final Cut Pro lics just to make it show in Self Service.
This way i can list a blank config profile in Self service and give it the FCP icon so the user feeling like they are installing it > then make a smart group for macs in this range > then scope the VPP FCP app to automatically install on any mac in this group.
I also see if the is FR for this and if not raise one.
Posted on 06-19-2017 12:30 PM
@jhbush1973 I discovered that the EA you shared with us might not work for me. I ran the command in Terminal as a test before putting the EA in place and here's what I get:
$ sudo profiles=`profiles -C -v | awk -F: '/attribute: name/{print $NF}'| sort | sed -e 's/^[ ]*//'`
Password:
sudo: cert+AVcerts: command not found
It choked on a profile I have named "802.1x+computer cert+AVcerts". Did it choke on the space before cert or did it choke on the +?
Posted on 06-20-2017 10:41 AM
From the post it looks like it failed on the space. The error message is saying that "cert+AVCerts" is not a valid command. You probably need to escape the space character some how.
Posted on 06-20-2017 11:39 AM
We have plenty of profiles with spaces in them, and the EA we use never has an issue getting the names. Here's what we use
#!/bin/sh
cProfiles=$(profiles -Pv | awk -F'attribute: name: ' '/attribute: name/{print $NF}')
echo "<result>$cProfiles</result>"
We have one that grabs the identifier names as well as the one above that gets the human readable names
#!/bin/sh
cProfilesIDs=$(profiles -Pv | awk -F'attribute: profileIdentifier: ' '/attribute: profileIdentifier/{print $NF}'
echo "<result>$cProfilesIDs</result>"
Finally, here's one I'm not using, but could be useful to someone. This gets both the names and the identifiers together and puts each grouping (name + identifier) on it's own line
#!/bin/sh
profilesAll=$(profiles -Pv | awk -F': ' '/attribute: name|attribute: profileIdentifier/{print $NF}' | sed 's/$/ =/;N' | paste -d" " - -)
echo "<result>$profilesAll</result>"
Posted on 06-20-2017 11:52 AM
@mm2270 That first one did the trick for my needs. Thanks!
Posted on 09-30-2019 08:44 AM
@bentoms Did this ever make it to be FR or more?