Skip to main content

Remove Jamf Pro (Casper JSS) Client Components

DescriptionWhat this Fileset does

ToThis macOS Fileset runs Jamf Pro's local jamf removeFramework command to remove allJamf Casper JAMF Software-relatedmanagement components from computersa thatcomputer have beenpreviously managed by Jamf Pro or Casper JSS. Confirm the JSS.Mac is ready to leave Jamf before deployment; removing the framework can end Jamf policy, inventory, and remote-management functions.

IngredientsRequirements

  • FWFileWave Central access to create and deploy a macOS Fileset
  • (OtherA tools,target features,Mac on which the Jamf binary is still installed and applicationsexecutable
thatA willpilot bedevice needed)and an approved Jamf offboarding plan

Directions

Create the Fileset

  1. CreateIn aFileWave newCentral, emptyopen FilesetFilesets (Fromand theselect Fileset View : New Desktop Fileset > Empty : Type a Name > OK).
  2. With it selected: ClickName the Fileset, select it, and open Scripts item in the button bar.
  3. Create aan newActivation activation script and name it.Script.
  4. Paste the script below andwithout editchanging the Jamf command unless your Jamf documentation requires a different supported removal method.
    #!/usr/bin/env zsh
    # This will remove JAMF from macOS
    
    # Function to identify the location of the jamf binary
    CheckBinary() {
        # Identify location of jamf binary using modern command substitution
        jamf_binary=$(which jamf)
    
        # Evaluate conditions to identify the correct binary path
        if [[ -z "$jamf_binary" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ ! -e "/usr/local/bin/jamf" ]]; then
            jamf_binary="/usr/sbin/jamf"
        elif [[ -z "$jamf_binary" ]] && [[ ! -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then
            jamf_binary="/usr/local/bin/jamf"
        elif [[ -z "$jamf_binary" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then
            jamf_binary="/usr/local/bin/jamf"
        fi
    
        # Error handling for missing jamf binary
        if [[ -z "$jamf_binary" ]] || [[ ! -x "$jamf_binary" ]]; then
            echo "Error: jamf binary not found or not executable."
            exit 1
        fi
    }
    
    # Function to remove the JAMF framework
    RemoveJamf() {
        "$jamf_binary" removeFramework || {
            echo "Error: Failed to remove JAMF framework."
            exit 2
        }
    }
    
    # Main script execution
    CheckBinary
    RemoveJamf
    
    # Exit with a success status
    exit 0
    
  5. AssociateDeploy the Fileset to a pilot Mac first, verify that Jamf management is removed and FileWave remains healthy, then expand the deployment as a standard or scheduled association.