Skip to main content

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!

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:



https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/setting_energy_saver_settings/powersettings.sh


@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!


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.


You could also just throw together a Smart Group that looks at the



Hardware Information: Model: is like "book"

Second what @krichterjr said.



We do the same & have done for an age.



For us, we scope the VPN profile to that group.


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.


In case you want it in a script rather than scoping:



sysctl hw.model

@krichterjr +1 on that solution, that's what we've always done.


Reply