Skip to content
All recipes

Lock or erase a departing employee's devices

Lock or erase each device a departing employee used, with your approval before every action.

Open in Claude Open in ChatGPT
Product
Endpoint Management
Platforms
macOS, iOS, iPadOS and more
Effect
Changes a device
Agent access
Iru MCP or the Iru API

Before you start

  • An Iru API token with MCP turned on and permissions that cover the calls below (recipe 1).
  • Back up anything you need to keep. Erasing permanently deletes all data and can't be undone.
  • Lock works on macOS, iOS, iPadOS, visionOS and Android. Erase works on macOS, iOS, iPadOS, tvOS and visionOS. Neither needs supervision.
  • Apple silicon Macs and Intel Macs with the T2 chip erase with Erase All Content and Settings (EACS), which fails unless a bootstrap token is escrowed.

Prompt for your agent

List every device in Iru assigned to [employee name or email], with each device's name, platform and serial number. Then stop. I'll tell you which devices to lock and which to erase. Before each action, show me the device and the action, and wait for my explicit approval. If you lock a Mac, show me the unlock PIN from the response.

Steps

  1. List the employee's devices

    Have the agent list every device assigned to the employee, with each one's name, platform and serial number.

    GET/api/v1/devices

    Source: Iru API: List Devices

  2. Choose lock or erase for each device

    A locked device can't receive an Erase Device command, so decide which action each device gets before you send anything.

    Source: Lock a device

  3. Lock a device after you approve

    Add an optional Message and PhoneNumber for the lock screen. A Mac restarts and locks with a six-digit PIN, which the response returns. Keep that PIN.

    POST/api/v1/devices/{device_id}/action/lock

    Approval requiredThe agent names the device and the action, then waits for your go on each one.

    Source: Lock a device

  4. Erase a device after you approve

    Intel Macs without the T2 chip erase by obliteration with a 6-digit PIN. On iPhone and iPad, ReturnToService re-enrolls the device after the erase. An offline device runs the command when it next connects.

    POST/api/v1/devices/{device_id}/action/erase

    Approval requiredErasing can't be undone. The agent names the device and waits for your go on each one.

    Source: Erase a device

Check it worked

  • After a Mac locks, its six-digit PIN is on the device record.

Common pitfalls

  • Locking an Apple silicon Mac running a macOS version before 11.5 deactivates it. Reactivating it needs a network connection and a local administrator with a Secure Token.
  • Apple silicon Macs don't take an erase PIN.
  • A Mac that still has a legacy firmware password erases completely and needs a macOS reinstall instead of EACS.
  • Mac and visionOS don't offer Return to Service.

FAQ

Which devices can I lock or erase?

Lock works on macOS, iOS, iPadOS, visionOS and Android. Erase works on macOS, iOS, iPadOS, tvOS and visionOS. Neither needs supervision.

How do I unlock a Mac after a remote lock?

The lock response returns a 6-digit PIN, which also shows on the device record. GET /api/v1/devices/{device_id}/secrets/unlockpin returns it later.

Can I erase a device that's already locked?

No. A locked device can't receive an Erase command, so choose one action per device.

What if the device is offline?

The command runs when the device next connects. An erase can't be undone once it runs.

Next steps

Sources

Stay up to date

Iru's bi-weekly collection of articles, videos, and research to keep IT & Security teams ahead of the curve.