You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows MDM profile removal is treated as best-effort, but there is no mechanism to surface failed-remove errors to admins. When a remove operation fails with an unusual error code (not 200/404/405/500), the failure is silently discarded — the row is deleted from host_mdm_windows_profiles with no record that the removal failed.
Apple's equivalent flow has an ignore_error column on host_mdm_apple_profiles that controls this: failed removes persist by default (with detail = "Failed to remove: ..."), and are only silently cleaned up when ignore_error = true. Windows has no such column.
Impact
Admins have no visibility into Windows profile removals that genuinely fail. While most remove errors are benign (404, 405, 500 are all mapped to "verified" by WindowsResponseToDeliveryStatusForRemove), a real failure (e.g., an unexpected CSP error) is silently dropped. There is no audit trail or UI indication that a profile may still be active on the device.
Proposed fix
Add an ignore_error column to host_mdm_windows_profiles (matching host_mdm_apple_profiles), and update updateMDMWindowsHostProfileStatusFromResponseDB to:
Delete failed-remove rows when ignore_error = true (best-effort, current behavior for all removes).
Persist failed-remove rows when ignore_error = false, with detail = "Failed to remove: ..." prefix (mirrors Apple's UpdateOrDeleteHostMDMAppleProfile).
Downstream consumers would also need updates:
windowsHostProfileStatusSubquery (~line 1813): filter out operation_type = 'remove' rows from failed-status aggregation, or only count them when ignore_error = false.
GetHostMDMWindowsProfiles (~line 3292): include failed-remove rows in per-host profile listings when ignore_error = false.
UPDATE, row persists with detail = "Failed to remove: ..."
UPSERT, row persists (no detail prefix)
DELETE row (best-effort, silent discard)
UPDATE, row persists with detail = "Failed to remove: ..." (Apple parity)
Pending
UPDATE, row persists
UPSERT (kept)
UPSERT (kept, no change)
UPSERT (kept, no change)
nil
UPDATE, row persists
UPSERT (kept)
UPSERT (kept, no change)
UPSERT (kept, no change)
Evidence
Apple parity reference: UpdateOrDeleteHostMDMAppleProfile in server/datastore/mysql/apple_mdm.go:3513-3532 — checks ignore_error before deciding to DELETE vs UPDATE for failed removes.
ignore_error column exists on host_mdm_apple_profiles but not on host_mdm_windows_profiles.
UPDATE: @noahtalerman: Closed this request because I pulled it into this separate request:
Problem
Windows MDM profile removal is treated as best-effort, but there is no mechanism to surface failed-remove errors to admins. When a remove operation fails with an unusual error code (not 200/404/405/500), the failure is silently discarded — the row is deleted from
host_mdm_windows_profileswith no record that the removal failed.Apple's equivalent flow has an
ignore_errorcolumn onhost_mdm_apple_profilesthat controls this: failed removes persist by default (withdetail = "Failed to remove: ..."), and are only silently cleaned up whenignore_error = true. Windows has no such column.Impact
Admins have no visibility into Windows profile removals that genuinely fail. While most remove errors are benign (404, 405, 500 are all mapped to "verified" by
WindowsResponseToDeliveryStatusForRemove), a real failure (e.g., an unexpected CSP error) is silently dropped. There is no audit trail or UI indication that a profile may still be active on the device.Proposed fix
Add an
ignore_errorcolumn tohost_mdm_windows_profiles(matchinghost_mdm_apple_profiles), and updateupdateMDMWindowsHostProfileStatusFromResponseDBto:ignore_error = true(best-effort, current behavior for all removes).ignore_error = false, withdetail = "Failed to remove: ..."prefix (mirrors Apple'sUpdateOrDeleteHostMDMAppleProfile).Downstream consumers would also need updates:
windowsHostProfileStatusSubquery(~line 1813): filter outoperation_type = 'remove'rows from failed-status aggregation, or only count them whenignore_error = false.GetHostMDMWindowsProfiles(~line 3292): include failed-remove rows in per-host profile listings whenignore_error = false.Status comparison table
ignore_error)ignore_errorcolumn)ignore_errorcolumn)detail = "Failed to remove: ..."detail = "Failed to remove: ..."(Apple parity)Evidence
UpdateOrDeleteHostMDMAppleProfileinserver/datastore/mysql/apple_mdm.go:3513-3532— checksignore_errorbefore deciding to DELETE vs UPDATE for failed removes.ignore_errorcolumn exists onhost_mdm_apple_profilesbut not onhost_mdm_windows_profiles.