Posted on 04-15-2021 04:46 PM
Hello All,
I recently added a M1 MacBook Pro to my JSS test environment. When I deploy the following battery cycle count extension to the M1 MBP, I get the following information back in the JSS.
echo "<result>$(ioreg -r -c "AppleSmartBattery" | grep -w "CycleCount" | awk '{print $3}' | sed s/"//g)</result>"
Is there another command I should be using specifically for the M1 MBP chip set? ¯_(ツ)_/¯
Posted on 04-15-2021 08:02 PM
Adjust the command to look like:
system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}'
So your Extension Attribute script will look like:
#!/bin/sh
echo "<result>$(system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}')</result>"
ioreg command has been unreliable for a while now