M1 Battery Health "Maximum Capacity" Extension Attribute

New Contributor III

Update: Only works on M1 Macs currently

The default "Battery Capacity" attribute in Jamf Pro wasn't reporting information correctly on the new M1 Macs. We were getting results of "1%" on brand new computers.

I used this post from @greatkemo as a template to create an updated extension attribute that works with M1 Macs. Waiting for results from Intel machines and older OS's but have confirmed this works for M1's on Monterey. Be sure to test before deploying:



#Show maximum capacity of battery compared to when it was new (100%)

echo "<result>$(system_profiler SPPowerDataType | grep "Maximum Capacity:" | sed 's/.*Maximum Capacity: //')</result>"

exit 0