There are variations on this general process out there as well, so pick your poison.Įdit: Here's a somewhat simplified version of the EA script that gets the same information, just doesn't need to do 2 possible curl commands to get it. See my post on this old FR for an example of how to do it. Your best bet is to implement an Extension Attribute that uses Apple's own process to identify the actual Mac name, and not go by some wacky translation table the way JAMF is doing. JAMF has a hardcoded table in the JSS database that translates the model ids into a human readable name, but since Apple is using the same id for multiple different models, well, you get the picture. Isn't a model identifier supposed to be unique to that specific hardware!? grrrr Apple!!)Īnyway, I've complained often about this myself before. (Aside: Who in their right, sane mind decided it was a good idea to re-use a model identifier. Its JAMF mostly, although in some cases, Apple is also to blame since they very stupidly started deciding to re-use model identifiers for different Macs. Hopefully that will help you get part of the way to your SG. I know this can be cleaned up a lot, and there might be a different way to do this, but I just wanted to prove it could be done with the code. Print "Usage: macmodelshelf.py serial_number" Print >sys.stderr, "Unknown model %s" % repr(sys.argv) Output = subprocess.check_output(['/usr/sbin/ioreg', Model = lookup_mac_model_code_from_apple(code)įor code, model in sorted(ems()): Print >sys.stderr, "Looking up %s from Apple" % code Return et.findtext("configCode").decode("utf-8") If len(serial) in (12, 13) and serial.startswith("S"): # Remove S prefix from scanned codes.ĭef lookup_mac_model_code_from_apple(model_code):į = urllib2.urlopen("" % model_code, timeout=2) If "serial" in serial.lower(): # Workaround for machines with dummy serial numbers. Print >sys.stderr, "Couldn't open macmodelshelf.db: %s" % e You'll need to place Per's macmodelshelf.db file somewhere on these machines and update the script to point to that location, but once done you have an EA that will return the model info. I took Per's code ( ), borrowed some code from ( ) and made a few changes to be able to use this as an EA. :-(ĭoes anyone have any suggestions for how I can create a smart group to differentiate between the two models of 2011 15" MacBook Pros? If it's pulling it from the machine, well damnit. If Casper is pulling the model name from a built-in database - STOP! Please. I can't use the GPU, they both have an AMD Radeon HD 6750M as possible configurations.I can't use the video RAM, they both have 1 GB GDDR5 as possible configurations.2.2/2.4/2.5) as a possible configuration. I can't use CPU speed, they both have an identical clock speed (2.0/ 2.2/2.3 vs.I can't use Model Number, they're both A1286.I can't use Model name, they're both 15-inch MacBook Pro (2011).I can't use Model ID, they're both MacBookPro8,2.But I've found no way of differentiating between at least the Early and Late 2011 15" machines. While the Late models of 2011 MacBook Pros (13/15/17) use version 3A222. This is a big problem for me because I'm trying to create smart groups for policies so we can deploy Apple Hardware Test to our machines since we reimage them (which removes AHT). But it becomes a big issue when trying to separate Early from Late 2011 machines (13, 15 or 17). I'm not sure if Casper is pulling this info from the hardware itself, or from an internal database. Not sure if it's Apple's issue or Casper.Īpple GSX (and MacTracker) lists the model name as "MacBook Pro (15-inch, Early 2011)" or "MacBook Pro (15-inch, Late 2011)" while Casper lists them both as "15-inch MacBook Pro (2011)"! You understand that you can unsubscribe at any time by using the unsubscribe link in any newsletter email.This is damn frustrating. By signing up for the newsletter you confirm that you have read and accepted our privacy policy.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |