Skip to main content

Add a Mac to Apple Business Manager Without Erasing It, Using Add2ABM

Add a Mac that's already in use to Apple Business Manager without erasing it, then enroll it in Swif.

Add2ABM is an open-source script that adds a Mac that's already set up and in use to Apple Business Manager (ABM) or Apple School Manager (ASM), without erasing it. Once the Mac is in Apple Business Manager, you can assign it to Swif, and enroll it with Automated Device Enrollment.

Important: Add2ABM isn't made, maintained, or supported by Swif. Add2ABM is an open-source project by Inetum Polska, published under the Apache 2.0 license at github.com/Inetum-Poland/add2abm. Swif doesn't develop, review, maintain, or support it, and isn't responsible for its results, including data loss, a Mac that can't be used, or failed enrollment. You use it at your own risk. Read the project's README before you start, back up the Mac, and test on a Mac you can afford to lose first.


When to use it

Use Add2ABM when a Mac:

  • is already set up, with users and data you need to keep, and

  • isn't in Apple Business Manager, for example because it wasn't bought from Apple or an authorized reseller, and

  • needs to be enrolled with Automated Device Enrollment

Normally, adding a Mac to Apple Business Manager with Apple Configurator means erasing it, and starting again at Setup Assistant. Add2ABM brings back Setup Assistant without erasing the Mac, so you can add it, then puts the Mac back as it was.

Don't use Add2ABM if the Mac:

Using it on these Macs makes adding the Mac fail, and can put its data at risk.

Who should run it: IT or support staff only, with the Mac in front of them. Users should never run it themselves.


Requirements

Requirement

Details

Mac

Apple silicon, or an Intel Mac with a T2 Security Chip, running macOS 14 or later

Activation Lock

Turned off, at least while you add the Mac

macOS Recovery

You can start the Mac in Recovery. If the Mac has a Recovery Lock password, have it ready.

Unlock the disk

The password of a user with a Secure Token, or the Mac's FileVault recovery key. If Swif manages the Mac, you'll find the key in Swif. See Apple FileVault Policy.

Internet connection

To download the script in Recovery

Apple Configurator

On an iPhone, signed in with an Apple Business Manager account that can add devices

Physical access

You need to be at the Mac. It can't be done remotely.

A backup

Back up the Mac before you start. Add2ABM doesn't delete data, but things can go wrong.


Warnings: read these first

Stop at "Select Your Country or Region." When Setup Assistant appears, go only as far as the Select Your Country or Region screen, then add the Mac. Going further can create conflicting settings on the Mac.

If adding the Mac fails, don't click Shut Down in Setup Assistant. It can erase the Mac on its next start, even if you go straight to Recovery. Press Command (⌘) + Q instead, and choose Shut Down in the window that appears. Or hold the power button to turn off the Mac.


How it works

Add2ABM runs in macOS Recovery, in two passes:

Pass

What it does

First run

Backs up the Mac's user records, and removes the setting that marks Setup Assistant as done. On the next start, Setup Assistant appears, so you can add the Mac to Apple Business Manager.

Second run

Restores the user records, and puts the setting back. The Mac starts normally, with its users and data.

The script asks before it makes any changes. Running it a second time puts the Mac back as it was.


Host the script yourself (optional)

By default, the commands below download the script from Inetum's server, add2abm.inetum.zone. If your security policy doesn't allow running scripts from outside servers, host it yourself:

  1. Download add2abm.sh from the project's Releases, or from the repository.

  2. Check its checksum against the one published in Releases, and review the script.

  3. Put it on a web server you control, which Macs can reach from macOS Recovery. Use HTTPS, if you can.

  4. In the steps below, replace add2abm.inetum.zone with your server's address and path. For example:

    sh <(curl -s https://scripts.yourcompany.com/add2abm.sh)

When the project releases a new version, update your copy, and check its checksum again.


Add the Mac

The steps below follow Add2ABM's README. Check the README for the latest steps before you start, since the project may change.

Part 1: Bring back Setup Assistant

  1. Turn off Activation Lock, if it's on.

  2. Shut down the Mac.

  3. Hold the power button, or Touch ID, until Options appears, and start macOS Recovery.

  4. Sign in with the user that owns the disk, and connect to the internet, if needed.

  5. Open Utilities > Terminal.

  6. Optional: check the script's checksum against the one in the project's Releases:

    curl -s add2abm.inetum.zone | sha256
  7. Run the script, and follow its prompts. If you host it yourself, use your own address. See Host the script yourself.

    sh <(curl -s add2abm.inetum.zone)

    The Mac restarts. Unlock the disk, if asked.

Part 2: Add the Mac to Apple Business Manager

  1. In Setup Assistant, go to the Select Your Country or Region screen, and stop there.

  2. Hold the iPhone, with Apple Configurator open, close to the Mac, and add the Mac to Apple Business Manager. Choose Swif as its MDM server, if you're asked.

  3. When the Mac shows that it was added, shut it down. Use Command (⌘) + Q, then Shut Down, not the Shut Down button in Setup Assistant.

Part 3: Put the Mac back as it was

  1. Start macOS Recovery again, sign in, and connect to the internet.

  2. Open Utilities > Terminal, and run the script again, from the same address:

    sh <(curl -s add2abm.inetum.zone)

    It restores the Mac's users, and restarts. Unlock the disk, if asked.

  3. Sign in to the Mac with a local administrator account.

Part 4: Enroll the Mac in Swif

  1. In Apple Business Manager, check that the Mac is assigned to your Swif MDM server. If it isn't, assign it.

  2. On the Mac, open Terminal, and run:

    sudo profiles renew -type enrollment

    The Mac shows a prompt to enroll in Swif. Follow it.

  3. In Swif, check that the Mac appears in Device Inventory, enrolled with Automated Device Enrollment.

Macs added with Apple Configurator have a 30-day provisional period. During it, the Mac's user can remove the Mac from management. After 30 days, they can't.


Troubleshooting

Adding the Mac fails

Don't click Shut Down in Setup Assistant. Press Command (⌘) + Q, and choose Shut Down. Then check the error:

Error

Likely cause

Code 33007, with 34000

Activation Lock is on. Turn it off, and try again.

Code 33007, with 33018

The Mac is already in Apple Business Manager or Apple School Manager. Don't use Add2ABM.

Code 202, "Transport could not connect"

A network problem between the iPhone and the Mac. Check both are online, and close together.

The script doesn't run as expected

Check that you're running it from macOS Recovery, not from a signed-in session, and that the disk was unlocked. To see what it's doing, run it with details:

sh -x <(curl -s add2abm.inetum.zone)

The Mac doesn't enroll in Swif

  • Check that the Mac is assigned to your Swif MDM server in Apple Business Manager.

  • Run sudo profiles renew -type enrollment again, from a local administrator account.

Getting help

  • For Add2ABM itself, such as the script's prompts, errors, or Recovery, see the project's README, or open an issue on GitHub. Swif support can't help with the script.

  • For enrolling the Mac in Swif, once it's in Apple Business Manager, contact Swif support.


Related resources

Did this answer your question?