more fixes for the scrubber

This commit is contained in:
2026-10-29 16:17:45 -04:00
parent a8b8429b58
commit 597524fc13
3 changed files with 61 additions and 12 deletions
+5 -1
View File
@@ -113,11 +113,15 @@ Recovery downloads a fresh package from Microsoft's evergreen Get Help link into
Logs include the trigger, native evidence where available, process result, and scenario result. The management log also records stdout/stderr byte counts and bounded excerpts from both the beginning and end, preserving startup errors and final results. The original stream logs retain full output. Get Help process exit `0` or `3010` **and** scenario result `00` are required; missing results, failures, or the `66`/`68` not-found results stop installation. It then verifies that scrub workers have finished, all detected Office registrations are gone, and previous Click-to-Run working/source state is cleared. Read/verification failures stop deployment. `office-scrub.stdout.log` and `.stderr.log` survive cleanup; the downloaded ZIP and extracted non-log files are removed by the same `finally` cleanup as other media.
**Observed Get Help limitation (October 29, 2026):** the current tool can print `Scenario completed successfully.` followed by `ExecutionResultDetails: Uninstall office is running in the background.` and return zero without a terminal scrub result. It launches `powershell.exe -File ...\GetHelpElevated\<id>\Run.ps1` outside the deployment workspace. The observed Microsoft launcher calls `Console.ReadKey()` in `finally` after either success or failure. This path is not reliably unattended. The script reports **background removal requires attended verification**, logs worker PIDs/commands, and stops before replacement installation. A generic success message, missing worker, or even an accompanying `00` cannot turn that background acknowledgement into verified removal. It does not kill the worker, inject a keystroke, modify Microsoft's signed scripts, or increase the timeout to mask the prompt.
Resolve existing workers before another deployment: inspect their console or final diagnostic report, complete any remaining work, and dismiss a finished prompt. A live PowerShell process alone does not reveal whether the scrub is active, failed, or finished. Get Help's observed logger writes `cse.amplify.diagaction.gethelp.officeuninstallalda_<timestamp>.log` directly in the **worker account's** `%LOCALAPPDATA%\DAFs` directory (not a subfolder named for the scenario). No report was found in the checked Administrator/System locations on the affected endpoint, so removal remains unverified. Do not infer success from missing logs or reuse the generated `GetHelpElevated` payload on the next deployment.
A verified scrub reports `3010` because Microsoft recommends a restart to finish cleanup. With `DeferReboot=true`, installation can continue after verification and the final receipt preserves the restart requirement. With `false`, the script returns `RestartRequiredBeforeInstall`. Returned Office-removal/install receipts include `ScrubRecoveryAttempted` and `ScrubRecoveryReason`. No automatic reboot or resume task is created. See [Microsoft's Office scrub guidance](https://learn.microsoft.com/en-us/troubleshoot/microsoft-365/admin/miscellaneous/get-help-office-uninstall).
Other ODT errors still stop for diagnosis. No automatic scrub is attempted after replacement installation begins, including a failed `RemoveMSI` check that could occur after the new suite is installed. A deployment already running an older script continues using that downloaded code: let it finish before starting another deployment.
Native installer processes, including ODT and the conditional scrub, are awaited until they and their process trees exit; there is no separate 30-minute installer cutoff. Syncro's two-hour limit remains the overall limit and is not reset between phases. Post-process verification allows five minutes for registration and background-worker state to settle; surviving Get Help/OffScrub workers block installation and artifact deletion. Waiting for active user cleanup and its reinstall-transition lock allows 20 minutes; the per-user scheduled task limit is 30 minutes. Those tasks may also run later for absent users. These allowances do not guarantee every endpoint finishes within two hours. If the RMM terminates a run, check for surviving installer processes before rerunning; the script does not kill an active installer to meet a time budget.
Native installer processes, including ODT and the conditional scrub, are awaited using `Start-Process -Wait`; there is no separate 30-minute installer cutoff. Get Help can detach a worker beyond that wait, as described above. Syncro's two-hour limit remains the overall limit and is not reset between phases. After a terminal scrub result, verification allows five minutes for registration and background-worker state to settle. Surviving Get Help/OffScrub workers, including `GetHelpElevated\...\Run.ps1`, block installation, new deployment downloads, and artifact deletion even outside the current workspace. Waiting for active user cleanup and its reinstall-transition lock allows 20 minutes; the per-user scheduled task limit is 30 minutes. Those tasks may also run later for absent users. These allowances do not guarantee every endpoint finishes within two hours. If the RMM terminates a run, check for surviving installer processes before rerunning; the script does not kill an active installer to meet a time budget.
Transient failures get bounded recovery before deployment stops: