This page applies to bare metal Mac host deployments only. It does not apply to MacStadium VDI or virtual machines, which cannot be registered with Apple Business Manager.
How it works
When a wipe is issued, the following sequence runs automatically:- The Mac reboots, connects to the network over wired Ethernet, and contacts Apple’s activation servers.
- ADE applies the PreStage profile, skipping all Setup Assistant screens and creating a managed admin account.
- The Mac enrolls in Jamf Pro. An enrollment-triggered policy fires immediately.
- The policy script creates a standard local temporary user account and forces a password change on first login.
- The script enables SSH directly on the machine.
- The script calls the Jamf API to send the
EnableRemoteDesktopMDM command to the device. - Jamf pushes the MDM command. Screen Sharing is enabled. A user can connect via VNC with the temporary credentials.
Prerequisites
- The Mac is physically connected via wired Ethernet with DHCP enabled on the switch port.
- The Mac is assigned to your MDM server in Apple Business Manager (ABM).
- The Mac supports Erase All Content and Settings: Apple Silicon or Intel with T2 chip, running macOS 12.0.1 or later.
- You have Jamf Pro admin access to create PreStage profiles, API clients, smart groups, scripts, and policies.
One-time setup
Complete these steps once. After setup, the recovery loop runs automatically for every subsequent wipe.Configure the PreStage Enrollment profile
In Jamf Pro, go to Computers > PreStage Enrollments and open or create the PreStage for your Mac fleet.General tab: Ensure the PreStage is assigned to your target devices in ABM.Setup Assistant tab: Select all items to skip. The machine must advance through Setup Assistant completely unattended.Account Settings tab:
- Enable Create a managed local administrator account during macOS Setup Assistant.
- Set a username (for example,
administrator) and password. - Enable Make the managed local administrator account MDM-enabled.
- Under Local User Account Type, select Skip. This prevents macOS from presenting the account creation screen during Setup Assistant.
Create an API client
Go to Settings > API Roles and Clients.Create an API Role with the following settings:
- Name:
Remote Access Provisioning - Privileges: Read Computers and Send Computer Remote Desktop Command
- Display Name:
Remote Access Provisioning - Role: assign the role you just created
- Token lifetime: 60 seconds
- Status: enabled
Create the monitoring Smart Group
This group gives you visibility into machines that still need remote access enabled. It is not used as a policy scope.
- Name:
Remote Management - Disabled - Criteria:
Remote Desktop EnabledisNo
Create the policy scope Smart Group
Using enrollment method as the criterion avoids race conditions with inventory collection timing.
- Name:
ADE Enrolled Machines - Criteria:
Enrollment MethodisPreStage Enrollment - Optional: add
PreStage Enrollmentis[your PreStage name]to target a specific PreStage.
Add the script
Go to Settings > Computer Management > Scripts > New.Set the Display Name to
Enable Remote Access Post-Enrollment.On the Options tab, set the following parameter labels:- Parameter 4:
API Client ID - Parameter 5:
API Client Secret - Parameter 6:
Jamf Pro URL - Parameter 7:
Temp Username - Parameter 8:
Temp Password
On a freshly wiped macOS install,
/usr/bin/python3 is a stub that triggers an Xcode Command Line Tools install prompt. In a headless session this fails silently. The script uses grep and cut instead, which are always available.Create the policy
Go to Computers > Policies > New.General payload:
- Display Name:
Enable Remote Access - Post Enrollment - Trigger: Enrollment Complete
- Execution Frequency: Ongoing
Enable Remote Access Post-Enrollment and fill in all five parameters:- Parameter 4: your API Client ID
- Parameter 5: your API Client Secret
- Parameter 6:
https://yourinstance.jamfcloud.com - Parameter 7: temp username (for example,
tempuser) - Parameter 8: temp password
ADE Enrolled Machines Smart Group. Save the policy.Recovery procedure
Once setup is complete, recovering a machine requires a single action.- In Jamf Pro, open the target machine’s inventory record.
- Click Management > Wipe Computer.
- Only check Clear Activation Lock if Activation Lock is confirmed active on the device.
- If prompted for a wipe passcode, enter any 6-digit value (for example,
123456). The secure enclave wipe bypasses it on modern macOS.
- Click Wipe. No further action is required.
EnableRemoteDesktop move from Pending to Completed. Policy Logs is the leading indicator: if the script succeeded, SSH is already up and the temporary user account exists before the MDM command finishes.
Verify the recovery
- Policy Logs:
Enable Remote Access - Post Enrollmentran and exited with code 0. - Management Commands:
EnableRemoteDesktopshows status Completed. - SSH:
ssh administrator@[machine-ip] - Screen Sharing: connect to
vnc://[machine-ip]and log in with the temporary credentials. - The machine no longer appears in the
Remote Management - DisabledSmart Group.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Machine stuck on account creation screen after wipe | Local User Account Type in PreStage not set to Skip | Edit PreStage Account Settings and select Skip under Local User Account Type |
| Machine does not appear in Jamf after wipe | ABM assignment not synced to Jamf | Go to Settings > Global > Device Enrollment Program > your ABM token > Sync Now |
| Script fails with token error | Client ID or Secret incorrect in policy parameters | Edit the policy Scripts payload and verify Parameters 4 and 5 |
| Temp user not created | Username or password missing from policy parameters | Edit the policy Scripts payload and verify Parameters 7 and 8 |
| Policy never fires after enrollment | Trigger not set to Enrollment Complete, or machine not in ADE Enrolled Machines group | Verify the policy trigger and Smart Group criteria |
| EnableRemoteDesktop queued but never completes | Machine lost network before Jamf could push the MDM command | Confirm wired Ethernet and DHCP; re-run the policy manually |

