Skip to main content
Question

Extension Attribute to Determine Wrong APN

  • July 5, 2023
  • 5 replies
  • 27 views

Forum|alt.badge.img+4

Good morning. We recently hit a APN snafu that resulted in a new APN and policy having to be pushed out. We are trying to find a script run as an extension attribute that can return either a "good" or "bad" result depending on what APN variable is stated. From there, we would make a smart group to see those endpoints in real time. Using Jamf Pro and managing MacOS machines. Thanks.

5 replies

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • July 5, 2023

@fotofojo The APNS certificate is installed on your Jamf Pro server, not your Macs. You should be able to determine which of your Macs aren't going to recognize the new APNS certificate by using a Smart Group to check their last enrollment date.


Forum|alt.badge.img+9
  • Contributor
  • July 5, 2023

Not sure this is exactly what you're looking for, but we use this EA to gather the APNS topic which should be consistent among all your machines which are properly enrolled. 

#!/bin/sh

topic=$(/System/Library/PrivateFrameworks/ApplePushService.framework/apsctl status | grep -m1 "com.apple.mgmt.External" | awk '{print $NF}')

echo "<result>$topic</result>"


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • July 6, 2023

Not sure this is exactly what you're looking for, but we use this EA to gather the APNS topic which should be consistent among all your machines which are properly enrolled. 

#!/bin/sh

topic=$(/System/Library/PrivateFrameworks/ApplePushService.framework/apsctl status | grep -m1 "com.apple.mgmt.External" | awk '{print $NF}')

echo "<result>$topic</result>"


@TrentO Thanks for sharing that EA, it's a good day when one learns something new. I'm definitely filing this away for future use.


Forum|alt.badge.img+9
  • Contributor
  • July 6, 2023

@TrentO Thanks for sharing that EA, it's a good day when one learns something new. I'm definitely filing this away for future use.


No problem. I can't take credit for the script. It was shared with me by a Jamf tech while troubleshooting an APNS issue we were having. So just passing it along 😁


Forum|alt.badge.img+4
  • Author
  • Contributor
  • July 15, 2023

@fotofojo The APNS certificate is installed on your Jamf Pro server, not your Macs. You should be able to determine which of your Macs aren't going to recognize the new APNS certificate by using a Smart Group to check their last enrollment date.


Thanks. We just need to determine which APN the device was currently getting.