Skip to main content
Question

Extension Attribute for Mac Model with Year.

  • January 26, 2022
  • 9 replies
  • 42 views

munirajuh
Forum|alt.badge.img+3

Hello, 

We are finding some error on current Extension Attribute  Mac model with Year on M1 Chip devices. Let me know any suggestions. 

9 replies

Bol
Forum|alt.badge.img+11
  • Contributor
  • January 26, 2022

Something like this maybe;

echo "<result>`/usr/sbin/sysctl hw.model | awk '{print $2}'`</result>"
<result>MacBookAir10,1</result>

 


Bol
Forum|alt.badge.img+11
  • Contributor
  • January 26, 2022

Sorry I just realised you wanted the marketing model, you can craft something from this;

/usr/bin/defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist 'CPU Names' | cut -sd '"' -f 4 | uniq
MacBook Air (M1, 2020)

 


junjishimazaki
Forum|alt.badge.img+10
  • New Contributor
  • January 26, 2022

Jamf inventory collection for each mac already displays the year/model of the Mac including the M1. If you go to the Hardware section of a Mac record it will display the make/model/year and the basic specs. 


munirajuh
Forum|alt.badge.img+3
  • Author
  • New Contributor
  • January 26, 2022

Sorry I just realised you wanted the marketing model, you can craft something from this;

/usr/bin/defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist 'CPU Names' | cut -sd '"' -f 4 | uniq
MacBook Air (M1, 2020)

 


Above lines are going more details. I will try on that. 


munirajuh
Forum|alt.badge.img+3
  • Author
  • New Contributor
  • January 26, 2022

Jamf inventory collection for each mac already displays the year/model of the Mac including the M1. If you go to the Hardware section of a Mac record it will display the make/model/year and the basic specs. 


Couple of M! Chip devices giving error like " ?xml version="1.0" encoding="utf-8" ?><root><error>0009</error><locale>en_US</locale></root>".  


junjishimazaki
Forum|alt.badge.img+10
  • New Contributor
  • January 26, 2022

You can run a policy to run recon on those macs to see if it reports back correctly


Forum|alt.badge.img+7
  • Contributor
  • January 27, 2022

Couple of M! Chip devices giving error like " ?xml version="1.0" encoding="utf-8" ?><root><error>0009</error><locale>en_US</locale></root>".  


Which models?  I have 74 Apple Silicon Macs and don't have any XML errors.  I am showing these models correctly:

MacBook Pro (13-inch, M1, 2020)
MacBook Pro (14-inch, 2021)
MacBook Pro (16-inch, 2021)


Bol
Forum|alt.badge.img+11
  • Contributor
  • January 27, 2022

Couple of M! Chip devices giving error like " ?xml version="1.0" encoding="utf-8" ?><root><error>0009</error><locale>en_US</locale></root>".  


@munirajuh Have you seen this extension attribute script, might be helpful as a reference or for testing. Came up in the recommendations

https://community.jamf.com/t5/jamf-pro/collect-year-from-mac-marketing-model-name/m-p/250495 



Forum|alt.badge.img+3
  • New Contributor
  • December 23, 2022

I'm trying to break down the result of "MacBook Pro (13-inch, M1, 2020)" to just "2020"
Has anyone had any luck / can give suggestions?