more fixes for scrubber
This commit is contained in:
@@ -109,13 +109,13 @@ Automatic recovery is limited to **one Get Help Office scrub per deployment**, b
|
||||
- ODT exits zero, but non-MSI Office registrations remain after the bounded verification wait.
|
||||
- ODT exits zero and product removal is verified, but previous Click-to-Run working configuration or deployment source references remain after their verification wait.
|
||||
|
||||
Recovery downloads a fresh package from Microsoft's evergreen Get Help link into this run's workspace, validates ZIP paths and the extracted executable's Microsoft signature, and invokes `GetHelpCmd.exe -S OfficeScrubScenario -AcceptEula`. The build observed on October 29, 2026 rejects the previously documented `-OfficeVersion All` option with `Error: Invalid command line arguments`, prints usage, and exits zero. The script therefore uses the example advertised by the tool itself and explicitly rejects argument/usage errors even with exit zero. The scenario targets detected Office installations; verification still requires all Office registrations, including MSI Office, Visio and Project, to be gone. It does not retry the scrub.
|
||||
Recovery downloads a fresh package from Microsoft's evergreen Get Help link into this run's workspace and validates ZIP paths and the executable's Microsoft signature. Only after recovery is selected, it runs `GetHelpCmd.exe -?` and validates the downloaded tool's own usage. It invokes `-S OfficeScrubScenario -AcceptEula`, adding `-OfficeVersion All` only when that switch is advertised. This restores the earlier scrubber's runtime argument detection; observed builds reject the documented optional switch while returning zero. Usage and removal output are logged separately. The scenario must remove all detected Office registrations, including MSI Office, Visio and Project. It does not retry the scrub.
|
||||
|
||||
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.
|
||||
Logs include the trigger, native evidence where available, process result, and scenario result. The management log records stdout/stderr byte counts and bounded beginning/end excerpts; original stream logs retain full output. Get Help must return `0` or `3010` with numbered result `00` or `Scenario completed successfully.`; explicit error text, usage errors, contradictory results and `66`/`68` not-found results stop installation. Every accepted response still requires workers to finish, all detected Office registrations to disappear, and previous Click-to-Run working/source state to clear. Read/verification failures stop deployment. The `gethelp-usage.*.log` and `office-scrub.*.log` files survive cleanup; downloaded non-log files are removed by the same guarded `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.
|
||||
When Get Help reports `Uninstall office is running in the background.`, the script now waits instead of failing immediately. It restores the earlier **30-minute background wait** and **60-second quiet interval**. Baseline process identities exclude pre-existing unrelated consoles; newly launched script/installer workers and explicitly identified scrub workers block completion. At least one identified scrub worker must be observed. Worker disappearance alone is insufficient: the script retains process handles to verify identified workers exited with `0` or `3010`, checks all Office registrations and previous deployment state, and requires all conditions to stay clear for the quiet interval. Failed/interrupted workers, inaccessible exit status, no observed worker, remaining products/state or a timeout stop installation. The overall Syncro limit still applies.
|
||||
|
||||
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.
|
||||
**Visible last-resort window:** Get Help may launch `powershell.exe -File ...\GetHelpElevated\<id>\Run.ps1` outside the deployment workspace and display it in a user's session. Leave it open during cleanup. The observed Microsoft launcher waits for a key in `finally` after either success or failure; dismiss a completed `Press any key to exit` prompt so verification can proceed. The window is not locked against closure. Get Help exposes no documented Office-scrub switch for that, and a handler registered in the RMM parent cannot protect another process; Windows still terminates a console process after a close signal ([console handler behavior](https://learn.microsoft.com/en-us/windows/console/handlerroutine)). The script monitors worker exit codes and endpoint state instead of modifying signed vendor scripts or injecting UI input. A successful process exit alone never proves removal. Get Help's diagnostic reports, when produced, are directly in the worker account's `%LOCALAPPDATA%\DAFs` as `cse.amplify.diagaction.gethelp.officeuninstallalda_<timestamp>.log`. Existing active workers block a new deployment; never reuse their payloads for the next run.
|
||||
|
||||
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).
|
||||
|
||||
@@ -193,6 +193,8 @@ Run `powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\tests\Install-Mic
|
||||
|
||||
`Run-Script` is unchanged. Its existing local execution can read the Syncro variables from the enclosing caller scope. The Office workload validates those values and reports its own result and exit code. The shim only sets TLS, dot-sources `Tools.ps1`, and invokes the workload. Existing `Run-Script` bootstrap failure behavior also remains unchanged.
|
||||
|
||||
Restored scrub tests cover advertised/unsupported arguments, both result formats, background acknowledgement, delayed inventory, a restarted quiet interval, a worker left at the keypress prompt, closed/failed workers, unknown worker identity, missing observed workers, stale state, and the 30-minute bound. An inert PowerShell child verifies that the retained process handle preserves a nonzero exit code after the child terminates. No actual scrubber is executed by the suite.
|
||||
|
||||
Endpoint acceptance still requires a VM pilot: existing MSI/C2R/Store Office, machine/per-user Teams and OneDrive, a logged-off profile, standard-user sign-in, wrong-license rejection, download failure, and the restart path. Verify new Outlook and Teams registration at sign-in, OneDrive migration, and that delayed cleanup preserves reinstalled apps. The implementation has not been run destructively against a real endpoint during development.
|
||||
|
||||
## Maintaining deployment definitions
|
||||
|
||||
Reference in New Issue
Block a user