Why not create a smart group that's Hardware model is like book & assign the policy to only install on machines in that smart group?
Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883
Audit wants this to be listed in their reports, so I wanted this to report this to Inventory. In addition, I wanted Desktops to return something like "Desktop: Does not require PGPWDE"
I've been told to comply to their "every request". However, I think I found a way...Instead of calling the model name from system profiler I can call the "Sudden Motion Sensor". Laptops are the only platform that have this installed correct?
This gets really tricky because of several factors
1) system_profiler command over the years and models has changed, so
making it "future-proof" could be an issue
2) Apple likes to change their models around, iMac 9,1 10,1 etc
So, I would maybe look at doing it like this, with a case construct
#!/bin/bash
# get the current model name of the machine
ModelName=`system_profiler SPHardwareDataType | awk '/Model Name:/ {
print $3 }'`
# now create a case construct to determine what to do
case $ModelName in
MacBook ) # computer type is laptop
/bin/echo "Model is a laptop, installing PGP'
/usr/sbin/jamf policy -trigger installPGP
;;
MacMini ) # computer is a desktop, and create receipt
/bin/echo "Model is a laptop, no need to install PGP"
/Library/Reciepts/pgp.txt
;;
iMac ) # Model is a desktop
/bin/echo "Model is a laptop, no need to install PGP" >
/Library/Reciepts/pgp.txt
;;
MacbookPro ) # model is a laptop
/bin/echo "Model is a laptop, installing PGP'
/usr/sbin/jamf policy -trigger installPGP
;;
esac
exit 0
This is totally proof of concept, you gotta test that out on your own.
I think you can maybe even wild card macbook, if the word "MacBook" is
in every single laptop Apple makes. So you could change MacBook to
MacBook* and not have to maintain every MacBook model in your script.
-Tom