11-07-2021 10:58 AM - edited 11-07-2021 11:49 AM
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:
#!/bin/sh
#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