The Problem

Microsoft Intune does not provide native alerting or automated notifications for Apple enrollment token and APNs certificate expiration events. This means administrators must manually log in to the Intune portal to check expiry dates — and if no one remembers, expired tokens go unnoticed until something stops working.

⚠ Potential Impact

Expired Apple tokens can cause: failure of new iOS/iPadOS device enrollments · inability to assign or distribute VPP applications · interruption of Intune management for all Apple devices · loss of mobile access to Microsoft 365, Wi-Fi, VPN, and corporate resources · reactive troubleshooting and increased operational overhead.

This guide implements an automated monitoring and email notification solution using Azure Automation and Microsoft Graph API — so your team gets a weekly report on token and certificate health before expiry causes a service disruption.

Glossary

APNs
Apple Push Notification service — Apple's cloud infrastructure for delivering MDM commands to Apple devices. Intune sends a "nudge" through APNs, which wakes the device and tells it to check in with the MDM server.
DEP
Device Enrollment Program — Apple's original name for Automated Device Enrollment (ADE), now managed through Apple Business Manager (ABM).
VPP
Volume Purchase Program — Apple's original name for ABM Apps and Books. The mechanism for purchasing and distributing apps in bulk to managed devices without requiring personal Apple IDs.
Automation Account
An Azure service that runs automated PowerShell or Python scripts in the cloud on a schedule or triggered by events — without needing a dedicated VM.
Runbook
A script that lives inside an Azure Automation Account and gets executed by it. The Automation Account is the container; the Runbook is the unit of work that actually runs.

How to Manually Check Token Status

Before automating, it helps to know where these tokens live in the Intune portal. Here's how to find each one.

Checking the Apple DEP Token

#Action
1Sign in to the Microsoft Intune admin center (intune.microsoft.com)
2Navigate to Devices
3Select Enrollment
4Under Apple, select Apple Mobile
5Click Enrollment Program Tokens
6Select the Apple server entry
7Review the Expiration Date field

Checking the Apple VPP Token

#Action
1Sign in to the Microsoft Intune admin center
2Navigate to Tenant Administration
3Select Connectors and Tokens
4Click Apple VPP Tokens
5Select the Apple server entry and review the token expiration

Checking the Apple APNs Certificate

#Action
1Sign in to the Microsoft Intune admin center
2Navigate to Devices
3Select Enrollment
4Under Apple, select Apple Mobile
5Click Apple MDM Push Certificate and review the expiry
Azure Setup

Azure Resource Group

As additional Microsoft 365 and Intune automation solutions are expected to be added over time, it's recommended to create a dedicated Azure Resource Group to centrally manage automation resources, reporting, access control, and Azure costs.

Create the Resource Group

#Action
1Sign in to the Azure Portal (portal.azure.com)
2In the search bar, type Resource Groups and select it
3Click + Create
4Enter the values from the table below, then click Review + Create → Create
ParameterValue
Namepandh-m365
RegionCanada East or Canada Central

Provision Resource Group Roles

Assign Contributor or Owner roles to the designated administrators who will manage automation resources within this group.

M365 Setup

M365 Admin Center — Notification Group

Create a Microsoft 365 Group that the automation runbook will use as the sender address for all notification emails. This group acts as a shared mailbox for automation alerts.

#Action
1Sign in to the Microsoft 365 Admin Center (admin.cloud.microsoft)
2In the left navigation, click Show All, then expand Teams & Groups
3Click Active Teams & Groups, then click Add a Team
4Enter the configuration below, then click Next → Add Team
FieldValue
NameP&H M365 Automation
DescriptionShared mailbox for Intune and M365 automation notifications
Team Emailpandh-m365-automation@pandh.ca
PrivacyPublic
Azure Automation

Azure Automation Account

Create the Automation Account

#Action
1Sign in to the Azure Portal (portal.azure.com)
2Search for Automation Accounts and click Create
3Configure the account with the parameters below
4Click Review + Create, then Create
ParameterValue
Account Namepandh-m365-automation
Resource Grouppandh-m365
RegionCanada East or Canada Central
IdentitySystem-assigned Managed Identity
ConnectivityPublic

Assign Graph API Permissions

The Automation Account's Managed Identity needs two Microsoft Graph API permissions to read token data and send notification emails.

#Action
1Open PowerShell 7 as a local administrator. Install from aka.ms/powershell if not present.
2Run the attached script: PandH_Azure_Automation_Permissions.ps1
3When prompted, authenticate with your Work or School account
4The script will assign the required Graph API permissions to the pandh-m365-automation Managed Identity
Graph API PermissionPurpose
DeviceManagementServiceConfig.Read.AllRead DEP / VPP / APNs token data from Intune
Mail.SendSend notification emails via Microsoft Graph

Set Up Automation Account Variables

#Action
1In the Azure Portal, navigate to the pandh-m365-automation Automation Account
2Under Shared Resources, click Variables
3Click + Add a variable and create the two variables below
Variable NameTypeValueEncrypted
AppleMonitor-MailSenderUPNStringEmail address of the sender — use the group email created above (e.g., pandh-m365-automation@pandh.ca)No
AppleMonitor-RecipientsStringComma-separated list of recipient email addresses to receive alerts (e.g., admin@pandh.ca, helpdesk@pandh.ca)No

Create the Runbook

📎 Before you start

Steps 4 and 5 require the PowerShell script file Apple Monitor RunBook PowerShell.ps1. This script is provided separately by Cantabria Consulting alongside this guide. Make sure you have it open and ready before continuing.

#Action
1Navigate to the pandh-m365-automation Automation Account in the Azure Portal
2Click Runbooks, then Create a Runbook
3Set Runbook name = PandH-AppleMonitor and Type = PowerShell 7.2
4Open the provided file Apple Monitor RunBook PowerShell.ps1 and copy the entire script contents
5Paste the script into the Runbook editor and click Save
6Click Test PaneStart to execute a test run
7Confirm the run completes with a green Completed status and the output report is visible in the pane
8Check the recipient inboxes to confirm the notification email was received
9Return to the Runbook editor and click Publish to make the Runbook production-ready

Create a Schedule

#Action
1In the Runbook, click Schedules, then + Add a schedule
2Click Link a schedule to your Runbook, then Create a new schedule
3Set the recurrence to Weekly — recommended: every Monday at 08:00 local time — then click Create
4Azure will automatically present a Parameters and run settings dialog. Leave the defaults as-is (the runbook reads its settings from the variables you created earlier) and click OK
Results

What You Get

Once deployed, the AppleMonitor Runbook executes automatically on your configured schedule and sends email notifications to your designated recipients.

✓ Automated Email Report Includes

Apple ADE/DEP token expiration date and remaining days to expiry · Apple VPP token expiration date and remaining days to expiry · Apple APNs certificate expiration date and remaining days to expiry.

This automation reduces operational risk by providing proactive visibility into Apple token and certificate health before a service interruption occurs — no more manual portal checks, no more surprised admins.