A comprehensive shell script for automating the migration and optimization of JAMF deployments on macOS systems.
- Automated removal of management profiles (some may need admin credentials)
- Azure MFA verification (may require assistance for disabling)
- OneDrive sync and migration handling (requires MFA to be disabled)
- Bulk application removal (applications can be added or removed via the script)
- JAMF enrollment automation
- System settings configuration
- Self Service app installation
- Root access
- macOS operating system
- JAMF Pro environment
- Azure account access
- Administrative privileges
- Download the script to your local machine
- Make the script executable:
chmod +x /path/to/jamf_migration_prep.sh
Run the script with sudo privileges:
sudo ./jamf_migration_prep.sh
-
Initialization
- Validates root access
- Sets up logging
- Identifies logged-in user
-
Profile Management
- Removes existing management profiles
- Verifies Azure MFA status
-
Data Migration
- Handles OneDrive sync issues
- Ensures file migration to OneDrive
- Removes OneDrive application
-
Application Management
- Removes specified applications
- Handles special cases (TeamViewer, Zoom)
- Empties trash
-
JAMF Enrollment
- Processes enrollment
- Updates computer name
- Configures Self Service options
-
System Updates
- Installs required applications
- Updates macOS to latest version
The script maintains detailed logs at:
/var/log/jamf_migration_prep.log
- Implements error catching and reporting
- Uses
set -e
for immediate exit on errors - Includes custom error handling function
- v1.7 (09/26/2024) - Latest version
Grant Huiras (io-grant)
- Ensure all data is backed up before running
- Verify Azure account settings before migration
- Monitor Self Service installations
- Allow sufficient time for MDM server synchronization