What It Does
The script is read-only. It stages the evidence in a local folder, writes a ZIP in ProgramData under MSPOutpost\Triage named for the UTC time, then removes the staging folder after it checks the ZIP. When it creates the triage folder it tries to restrict access to SYSTEM and Administrators and warns if it cannot. It does not reset permissions on an existing folder. Run it before rebooting or reimaging.
The ZIP holds CSV and text files: every running process with its command line, parent, path, Authenticode signature status and signer, and the SHA-256 of the program file for up to 400 distinct files; services and non-Microsoft scheduled tasks; autoruns from the Run and RunOnce keys, Winlogon and the startup folders; and possible ransom notes in user folders changed in the last 7 days, at most 200 files and 60 seconds.
It also holds TCP connections and UDP endpoints with the owning process, the DNS client cache, the Security, System and Microsoft Defender Operational event logs of the last Hours hours exported with wevtutil, local users, local administrators and who is signed in, Volume Shadow Copy state, and a summary.txt of what was collected and what failed.
A section that cannot be collected is a warning and noted in summary.txt, and the rest still goes into the ZIP. The answer is the ZIP path and size. Copy the ZIP off the PC and treat it as sensitive.
Before You Run It
- Run it before the PC is rebooted, reimaged or shut down. A reboot clears processes and connections.
- Make sure there is 1 GB free on the system drive.
- Copy the ZIP off the PC yourself. It is not uploaded anywhere. Treat it as sensitive.
- Raise Hours when the incident may have started more than a day ago. The default is 24.
Type and Risk
- Type: Report. It collects facts into a table and never alerts. It exits 0, or 2 when it could not run.
- Risk: Low. It reads and changes nothing.
- Restart: It never restarts the machine.
- Typical run: 1 to 5 minutes.
- Example answer: "Triage ZIP: C:\ProgramData\MSPOutpost\Triage\20261116-141500.zip (12.3 MB, 16 files, events of the last 24h); possible ransom notes: 2"
- Tested before listing on Windows 11 with Windows PowerShell 5.1, run as SYSTEM, against its own test cases.
Inputs
Pass an input as an argument (-Name value), as an environment variable with the same name, which is how most RMMs pass script variables, or change its default in the param() block at the top of the script. An argument wins over an environment variable, which wins over the default.
- Hours: How many hours of Security, System and Defender events to export. Whole number, 1 to 720. Default 24.
Every script also takes DryRun, OutputFormat (Text, Answer, Json or Csv), ExportPath and ResultField, which writes the answer to an RMM custom field.
License
Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.