lab-toolkit

Lab computer quick fixes

Find the problem, copy the command, and paste it into Terminal (Mac) or PowerShell (Windows). New here? Read How to use this site first.

Safe for anyoneNeeds admin passwordIT staff only

Scripts

Mac: Retire or resell a Mac

Check a Mac for leftover management software

Needs admin password

Use when: You need to confirm a Mac is fully cleaned up before it is erased, resold, or sent to surplus.

What it does: Lists any remaining device-management profiles, Jamf or BeyondTrust software, and background items. Changes nothing.

Next: Every section should say "none" and enrollment should say "No". If not, give the output to IT staff.

curl -fsSL https://spieles.us/mac/decommission/verify.sh | sudo zsh

View script · Read the guide

Remove BeyondTrust (admin-rights manager)

IT staff only

Use when: A Mac that is being retired keeps blocking admin passwords or shows BeyondTrust pop-ups. Run this first, before removing Jamf.

What it does: Runs BeyondTrust's own uninstaller and deletes its leftover folders. Removes software, so it cannot be undone.

curl -fsSLO https://spieles.us/mac/decommission/remove-beyondtrust.sh && sudo zsh remove-beyondtrust.sh --dry-run

View script · Read the guide

Remove Jamf and Self Service

IT staff only

Use when: A Mac released from university management still shows Self Service, Jamf, or "register this device" pop-ups from Microsoft.

What it does: Removes Jamf, Self Service, Jamf Connect, and the Conditional Access helper that causes the Microsoft pop-ups. Removes software, so it cannot be undone. Restart afterward.

Next: Restart, then run "Check a Mac for leftover management software".

curl -fsSLO https://spieles.us/mac/decommission/remove-jamf.sh && sudo zsh remove-jamf.sh --dry-run

View script · Read the guide

Windows: Windows PC setup and management

Show this PC's management status

Safe for anyone

Use when: Start here for almost any Windows PC problem, or when IT asks for the computer's serial number or status.

What it does: Shows the computer name, serial number, and whether the PC is connected to the university's management (Intune, Entra, and Active Directory). Changes nothing.

Next: Take a screenshot of the output and include it in your ticket or message to IT.

irm https://spieles.us/win/intune/get-device-info.ps1 | iex

View script · Read the guide

Check in with Intune now

Needs admin password

Use when: An app or setting that should be on the PC is missing, or IT just changed something and asked you to sync.

What it does: Asks the PC to check in with Intune right away instead of waiting. Installs or removes nothing by itself. Changes can still take 15–30 minutes to appear.

irm https://spieles.us/win/intune/sync-intune.ps1 -OutFile sync-intune.ps1; powershell -ExecutionPolicy Bypass -File .\sync-intune.ps1

View script · Read the guide

Clear the "not properly managed" sign-in message

IT staff only

Use when: The PC was added to its building group and has synced, but the "not properly managed" message still appears at sign-in.

What it does: Deletes the old message from the registry. Reboot afterward. If the PC is still missing its group, the message comes back.

irm https://spieles.us/win/intune/clear-logon-notice.ps1 -OutFile clear-logon-notice.ps1; powershell -ExecutionPolicy Bypass -File .\clear-logon-notice.ps1

View script · Read the guide

Register an existing PC with Autopilot

IT staff only

Use when: An older or reused PC needs to be re-imaged, but its serial number is not listed in Intune Autopilot.

What it does: Uploads the PC's hardware ID to Intune so it can be set up automatically after a reset. Requires an Intune admin sign-in.

Next: Add the PC to its groups, wait for "Assigned", then reset. Follow the re-image guide.

irm https://spieles.us/win/intune/register-autopilot.ps1 -OutFile register-autopilot.ps1; powershell -ExecutionPolicy Bypass -File .\register-autopilot.ps1 -Assign

View script · Read the guide

Guides