Posted on 03-11-2014 01:51 PM
Good afternoon fellow JAMFanatics (TM?) ;)
As I'm sure many of you are, we're stuck deploying Mavericks to the new model MBPs, Airs, and Mac Pros. For our portables, we're getting complaints about the new 'feature' that the user sees in regards to the policy update popup when they log into their Macs and they can't contact the JSS. (For reference: https://jamfnation.jamfsoftware.com/discussion.html?id=8777)
In an effort to curtail that, I'm planning on modifying our standard settings script to disable this check if the machine is a portable. However, I can't seem to find an easy way to determine if it's a portable or desktop. I know system_profiler can be used to pull the model number and whatnot, but I'd rather not try and grep/awk and build a nested if statement if I can help it.
Does anyone know a command or another method to easily return if the machine is a portable? If not, I'll write up a script to determine it and post it here for future reference.
Thank you!
Solved! Go to Solution.
Posted on 03-11-2014 01:55 PM
I've used this command to tell me if I'm on a laptop or otherwise:
/usr/sbin/system_profiler SPHardwareDataType | grep "Model Identifier" | grep "Book"
I'm using it here in this script:
Posted on 03-11-2014 01:55 PM
I've used this command to tell me if I'm on a laptop or otherwise:
/usr/sbin/system_profiler SPHardwareDataType | grep "Model Identifier" | grep "Book"
I'm using it here in this script:
Posted on 03-11-2014 01:58 PM
@rtrouton, that's a great idea! I wouldn't have though to check for a blank value if it didn't return book. Thank you!
Posted on 03-11-2014 01:58 PM
Or ioreg to do basically the same-
ioreg -rd1 -c IOPlatformExpertDevice | awk -F'["|"]' '/model/{print $4}' | grep "Book"
A script like Rich's or this will be your best bet. The term "Book" would only appear in a laptop, never in a Desktop Mac model.
Posted on 03-11-2014 02:01 PM
You could also just throw together a Smart Group that looks at the
Hardware Information: Model: is like "book"
Posted on 03-11-2014 04:36 PM
Second what @krichterjr said.
We do the same & have done for an age.
For us, we scope the VPN profile to that group.
Posted on 03-12-2014 04:13 AM
Third what @krichterjr said.
Model: is like MacBook Pro Model: is like MacBook Air Model: is like MacBook
That will neatly catch everything. Further scoping is left to your own requirements.
Posted on 03-20-2014 03:12 PM
In case you want it in a script rather than scoping:
sysctl hw.model
Posted on 03-20-2014 04:10 PM
@krichterjr +1 on that solution, that's what we've always done.