Ending Application-In-Use Update Failures on Managed Macs
Stop repetitive helpdesk tickets by automating locked-app detection and force quit before Mac software updates run via Jamf Pro or Intune.

Advertising disclosure: this article includes partner links. KBY may earn a commission if you sign up or buy through one, at no extra cost to you. How we make money.
Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.
Every fleet running Jamf Pro or Microsoft Intune has the same recurring ticket: a managed application update is pushed, the installer exits with a non-zero code, and the helpdesk queue fills with “update failed” tickets for Zoom, Chrome, Slack, or any app that locks its own binary while running. The underlying cause is almost always the same: the application was open when the installer tried to replace it.
The Old Way: a technician receives the failure ticket, remotely connects via Apple Remote Desktop or Jamf Remote, asks the user to save their work, force quits the application manually, and re-runs the policy by hand. This is repeated hundreds of times per patch cycle across a large fleet, consumes technician hours that scale linearly with headcount, and frustrates users who lose unsaved work when a technician force-quits without warning.
The New Way: a pre-flight guard script runs before the installer payload, detects the locking process, gives the user a bounded, self-service deferral window with a countdown notification, asks the app to quit once the window expires, escalating to a forced kill only if it refuses, and logs every decision as a structured evidence trail.
The policy only proceeds to install once the process is confirmed dead. No technician touches the device, and every outcome is reportable as a compliance signal in both Jamf Pro and Intune.
#Prerequisites and Permissions
- Jamf Pro 10.x or later with Script and Policy management rights (minimum role: Jamf Pro custom privilege set with Create/Read/Update Scripts and Create/Read/Update Policies, not full administrator).
- Devices enrolled via Apple Business Manager and managed by Jamf Pro or Intune. Both management agents already run policy scripts with administrative privileges; no Privacy Preferences Policy Control (PPPC) payload is needed for that.
- jamfHelper binary present at its default path (installed automatically with the Jamf Pro management framework).
- For Intune-managed Macs: Shell script policies enabled under Devices > Scripts, and Custom Compliance policies enabled under Devices > Compliance policies (check Microsoft’s custom compliance documentation for the current macOS and agent version requirements).
- Test scope: a single smart group or Azure AD dynamic group of no more than 25 pilot devices before fleet-wide scoping.
- Blast radius: limited to the targeted application’s process and its own installer payload. The script never touches unrelated processes or files.
#Implementation Steps
#Step 1: Build the pre-flight guard script
Action: Create a bash script that checks for the target process, offers a bounded deferral, then force quits before handing control back to the policy.
1#!/bin/bash
2
3# app-update-guard.sh
4# Prevents failed "Application in Use" installs by detecting locking processes,
5# giving the user a bounded deferral window, then force-quitting before the
6# installer payload runs.
7
8APP_PROCESS="zoom.us"
9APP_DISPLAY_NAME="Zoom"
10MAX_DEFERRALS=3
11DEFER_PLIST="/Library/Application Support/OpsPlaybook/zoom_defer_count.plist"
12LOG_FILE="/var/log/mac-ops/app-update-guard.log"
13JAMF_HELPER="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
14
15mkdir -p "/var/log/mac-ops"
16mkdir -p "/Library/Application Support/OpsPlaybook"
17
18# Never force quit without being able to warn the user first.
19if [ ! -x "$JAMF_HELPER" ]; then
20 echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: jamfHelper missing, aborting without quitting the app." >> "$LOG_FILE"
21 exit 1
22fi
23
24log() {
25 echo "$(date '+%Y-%m-%d %H:%M:%S') $1" >> "$LOG_FILE"
26}
27
28get_defer_count() {
29 if [ -f "$DEFER_PLIST" ]; then
30 /usr/libexec/PlistBuddy -c "Print :DeferCount" "$DEFER_PLIST" 2>/dev/null || echo 0
31 else
32 echo 0
33 fi
34}
35
36set_defer_count() {
37 /usr/libexec/PlistBuddy -c "Delete :DeferCount" "$DEFER_PLIST" 2>/dev/null
38 /usr/libexec/PlistBuddy -c "Add :DeferCount integer $1" "$DEFER_PLIST" 2>/dev/null ||
39 /usr/libexec/PlistBuddy -c "Add :DeferCount integer $1" "$DEFER_PLIST"
40}
41
42PID_COUNT=$(pgrep -x "$APP_PROCESS" | wc -l | tr -d ' ')
43
44if [ "$PID_COUNT" -eq 0 ]; then
45 log "No blocking process found for $APP_DISPLAY_NAME. Proceeding with install."
46 rm -f "$DEFER_PLIST"
47 exit 0
48fi
49
50DEFER_COUNT=$(get_defer_count)
51
52if [ "$DEFER_COUNT" -lt "$MAX_DEFERRALS" ]; then
53 NEW_COUNT=$((DEFER_COUNT + 1))
54 set_defer_count "$NEW_COUNT"
55 log "Deferral $NEW_COUNT of $MAX_DEFERRALS offered to user for $APP_DISPLAY_NAME."
56
57 "$JAMF_HELPER" -windowType utility -title "Update Ready: $APP_DISPLAY_NAME" \
58 -heading "Please save your work" \
59 -description "$APP_DISPLAY_NAME needs to close to finish an update. It will close automatically in 5 minutes. Save your work now." \
60 -button1 "OK" -defaultButton 1 -timeout 300 &
61
62 sleep 300
63fi
64
65RUNNING_AFTER_WAIT=$(pgrep -x "$APP_PROCESS" | wc -l | tr -d ' ')
66
67if [ "$RUNNING_AFTER_WAIT" -gt 0 ]; then
68 log "Sending terminate signal to $APP_DISPLAY_NAME after deferral window."
69 pkill -TERM -x "$APP_PROCESS"
70 sleep 10
71 if pgrep -x "$APP_PROCESS" >/dev/null; then
72 log "$APP_DISPLAY_NAME ignored terminate signal. Sending kill signal."
73 pkill -KILL -x "$APP_PROCESS"
74 sleep 5
75 fi
76fi
77
78STILL_RUNNING=$(pgrep -x "$APP_PROCESS" | wc -l | tr -d ' ')
79
80if [ "$STILL_RUNNING" -gt 0 ]; then
81 log "ERROR: $APP_DISPLAY_NAME still running after kill signal. Aborting install."
82 exit 1
83fi
84
85log "$APP_DISPLAY_NAME successfully cleared. Handing off to installer payload."
86rm -f "$DEFER_PLIST"
87exit 0pkill sends SIGTERM first, which lets most apps quit cleanly, and SIGKILL only if the app is still running ten seconds later; a killed app loses unsaved work, so keep the pilot cap. The script does not detect an active call or meeting.
Its 300-second wait keeps the policy or script run open, so check the script timeout of your management agent before lengthening it.
Evidence: a timestamped entry in /var/log/mac-ops/app-update-guard.log for every run.
12025-03-11 09:14:02 Deferral 1 of 3 offered to user for Zoom.
22025-03-11 09:19:03 Zoom successfully cleared. Handing off to installer payload.#Step 2: Upload the script to Jamf Pro
Action: Add the script under Settings > Computer Management > Scripts, priority set to Before.
Evidence: script ID visible in the Jamf Pro script list and referenced in the policy log.
#Step 3: Chain the guard script ahead of the installer payload
Action: Build a policy with two payloads in order: (1) the guard script, priority Before, (2) the Installomator-based install command or PKG payload, priority After. Scope to the pilot smart group first.
A safer design is to keep the install in a separate policy with a custom trigger and have the guard script call it (for example jamf policy -event install-zoom) only after the app is cleared; test whichever design you choose in your own Jamf Pro version.
Evidence: Policy Logs show “Script completed successfully” or “Script failed” against the guard script step, independent of the installer step status.
#Step 4: Configure the smart group trigger
Action: Create a Jamf Pro smart group using the criterion Application Title is Zoom.app and Application Version is not the current target version, and scope the policy to run on recurring check-in.
Evidence: smart group membership count matches the expected out-of-date population reported in Jamf Pro inventory.
#Step 5: Mirror the logic for Intune-managed Macs
Action: Deploy the same guard script as a Shell Script policy under Devices > Scripts, with Run script as signed-in user set to No so it runs with administrative privileges. Intune does not document any ordering between a standalone shell script and an app deployment, so it cannot be relied on to run just before the install.
Where possible, attach the guard as the pre-install script of a macOS PKG app instead, which Intune runs before installing that app, and check Microsoft’s current documentation for how a non-zero exit is handled.
Evidence: script run status “Success” visible in the Intune admin centre under the script’s device status report.
#Step 6: Publish a compliance signal for reporting
Action: Write a separate POSIX shell discovery script that reports the current deferral count. Custom compliance discovery scripts are not Shell Script policies: upload this one to the Intune admin center as a macOS compliance script, then select it in the Custom Compliance setting of a macOS compliance policy, where the JSON below is added. The setting name in the JSON must match the key the script outputs.
1#!/bin/bash
2# Intune custom compliance discovery script for app-update-guard state.
3DEFER_PLIST="/Library/Application Support/OpsPlaybook/zoom_defer_count.plist"
4
5if [ -f "$DEFER_PLIST" ]; then
6 DEFER_COUNT=$(/usr/libexec/PlistBuddy -c "Print :DeferCount" "$DEFER_PLIST" 2>/dev/null)
7else
8 DEFER_COUNT=0
9fi
10
11printf '{"AppUpdateGuardDeferrals": %s}\n' "$DEFER_COUNT"
12exit 0Action: add the matching JSON file to the same compliance policy, immediately after selecting the discovery script.
1{
2 "Rules": [
3 {
4 "SettingName": "AppUpdateGuardDeferrals",
5 "Operator": "LessThan",
6 "DataType": "Int64",
7 "Operand": 3,
8 "MoreInfoUrl": "https://learn.microsoft.com/en-us/mem/intune/protect/compliance-custom-script",
9 "RemediationStrings": [
10 {
11 "Language": "en_US",
12 "Title": "Application update deferral limit reached",
13 "Description": "Quit the pending application to allow the managed update to complete."
14 }
15 ]
16 }
17 ]
18}Because non-compliance can block access through conditional access, start with the policy assigned to the pilot group and review results before using it for access decisions.
Evidence: compliance state “Not compliant” with reason “AppUpdateGuardDeferrals” visible in the Intune device compliance report.
#Step 7: Wire a failure webhook for escalation
Action: Configure a Jamf Pro webhook subscription on the ComputerPolicyFinished event, posting to an internal automation endpoint that ignores every policy except the guard policy ID and opens a ticket only when successful is false.
The payload below is abridged: the event carries the policy ID, a success flag and a computer block, but check the Jamf Pro webhooks documentation for the exact fields, and have the endpoint fetch script output such as the last log line from the policy log through the API, because it is not in the payload.
1{
2 "webhook": {
3 "id": 42,
4 "name": "AppUpdateGuard-PolicyFailed",
5 "url": "https://ops-automation.kby.example.com/webhooks/jamf/policy-failed",
6 "contentType": "application/json",
7 "webhookEvent": "ComputerPolicyFinished"
8 },
9 "event": {
10 "policyId": 187,
11 "successful": false,
12 "computer": {
13 "jssID": 5521,
14 "deviceName": "MAC-FIN-0231",
15 "serialNumber": "C02XXXXXXXXX",
16 "username": "j.smith"
17 }
18 }
19}Evidence: ticket created with the device name and username from the webhook payload and the last guard log line fetched by the endpoint from the policy log, requiring no manual triage step.
#Step 8: Expand the pattern across the app catalogue
Action: Parameterise the script (APP_PROCESS and APP_DISPLAY_NAME as Jamf Pro script parameters 4 and 5, or Intune script arguments) and reuse the same policy structure for every application in the update catalogue that is known to lock its binary during installs, such as Chrome, Slack, and Microsoft Teams.
Evidence: Jamf Pro policy history shows the same script ID referenced across multiple policies with different parameter values.
#Verification and Expected Evidence
- Confirm the guard script log file exists on a pilot device after a scoped policy run: /var/log/mac-ops/app-update-guard.log contains a completed entry with exit code 0.
- Confirm the installer payload only executed after the guard step by checking the Jamf Pro Policy Log timestamp ordering for the two payload steps.
- Confirm the deferral dialog appeared on a live test device by capturing a screenshot or screen recording during the pilot run.
- Confirm the Intune script run report shows “Success” and the compliance report shows the correct deferral count for the same pilot device.
- Confirm the webhook fired exactly once for a deliberately forced failure (simulate by relaunching the app immediately after it is killed) and that a test ticket was created with correct field mapping.
Following along? Tap a step’s number to tick it off.
#Rollback
If the guard script causes unexpected side effects, such as blocking installs indefinitely due to a process name mismatch, disable the policy scope immediately in Jamf Pro (set scope to no devices) or disable the Intune assignment. Remove the deferral plist from affected devices with a single cleanup script pushed as an emergency policy:
1#!/bin/bash
2rm -f "/Library/Application Support/OpsPlaybook/zoom_defer_count.plist"
3exit 0Because the guard script never modifies application binaries, installer receipts, or system settings, rollback carries no data-loss risk. The only stateful artefact is the deferral counter plist, which is safe to delete at any time.
#Failure and Escalation Conditions
- Wake a human technician when the webhook fires more than five times in one hour across the fleet, indicating a systemic issue such as a process name change after an app update.
- Escalate to L2 if a single device reports three consecutive failed guard runs (visible in the compliance report as a sustained deferral count of 3 with no reduction over 48 hours).
- Escalate to L3 if the guard script itself fails to execute (Jamf Pro reports “Script error” rather than a controlled exit code), which typically indicates a syntax error, a missing interpreter, or a script that was not saved with the policy.
- Monitoring signal: a Jamf Pro Advanced Computer Search saved as “Guard Script Failures – Last 7 Days” filtered on the last script exit code, reviewed daily by the automation owner.
#Measuring Ticket Deflection
Baseline the current volume of “application in use” or “update failed” tickets tagged against the target application over the prior 90 days. After deployment, track three figures monthly: the count of guard script executions that exited 0 without any technician involvement, the count of genuine escalations that reached the ticketing system, and the ticket volume for the same application category.
A successful rollout typically shows escalations at under 5 percent of total guard executions, with the corresponding ticket category dropping by 80 percent or more within the first full patch cycle, since only genuinely stuck devices ever generate a ticket.
#References
For platform-level behaviour and configuration options referenced in this playbook, see Apple Platform Deployment guide, Apple Device Management documentation, Microsoft Intune custom compliance policy documentation, and Jamf Pro Policies documentation.
#Related reading
Mobile Application Management for BYOD: MAM Without Enrolment
Stopping App Update Tickets: Automating Background Task Approval
Recovery Lock Rotation for Apple Silicon Macs at Scale
Tracing an Endpoint and Device Management Problem with Microsoft Intune
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
About this page
Credited to
Dates
Published
Found this useful? Follow KBY for more like it.
Recommended reading
More from KBY that goes with this article.
Related articles
Application Lifecycle
Stopping App Update Tickets: Automating Background Task Approval
Stop manual login-item approvals for Chrome, Zoom and Slack updaters by pre-authorising Background Task Management via MDM and Jamf smart groups.
ReadConsumer tech
Fitbit Sense and Versa Stop Taking Third-Party Apps and Clock Faces: What Owners Should Do
From 28 November older Fitbit watches cannot install or update third-party apps and clock faces. Deleting or resetting removes them for good.
ReadPolicy and regulation
Cyber Essentials Compatible Managed Service: What the NCSC Badge for IT Providers Covers
The NCSC and IASME have launched a badge for managed IT services assessed against Cyber Essentials. It covers one named service, not the customer. Here are five checks to make.
ReadDiscover more
Graduate Learning
- TutorialWorking Out Why an Intune App Install Failed on One Windows Device
- TutorialNarrowing an Intune Policy to the Right Devices with an Assignment Filter
- TutorialCollecting Diagnostics from a Windows Device in Intune and Reading What Comes Back
- TutorialTracing an Endpoint and Device Management Problem with Microsoft Intune
Ops Playbook
- PlaybookInstall containerd on Autopilot Laptops Without Rebooting Mid-Provisioning
- PlaybookReplace Remote-Control Sessions With Intune Device Query for First-Line Windows Triage
- PlaybookFind the Windows Apps That Crash Most With Intune’s Application Reliability Report
- PlaybookDeploy Teams Rooms on Windows With Autopilot Self-Deploying Mode and Autologin
Lexicon Definitions
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Operate smarter, with fewer recurring tickets.
Receive new operational playbooks, incident-prevention guidance, automation scripts and recovery runbooks.




Comments
Add a thoughtful note on Ending Application-In-Use Update Failures on Managed Macs. Comments are checked for spam and held for moderation before appearing.