What It Does
The script reads diagnostics as SYSTEM: computer name, signed-in user, Windows version and build, IPv4 addresses, uptime, free space on the system drive, and up to 50 Error and Critical events from the Application log in the last EventMinutes minutes. It writes them with the user's description into report.txt and zips it under ProgramData\MSPOutpost\ProblemReports, a folder only SYSTEM and administrators can read. Reports older than KeepDays are deleted.
When the secure variable ProblemReportWebhook holds an https address, it sends the zip there as one POST with the content type application/zip and checks for a 2xx answer. The address is treated as a secret and never printed. Most chat and ticketing webhooks do not accept a file this way, so put a small receiver of your own in front of them.
It shows no dialog: the description comes from the Description input, filled in by your RMM, a shortcut or your help desk. It takes no screenshot. Ask the user to attach a picture to the ticket if you need one. Nobody signed in is a skip.
Before You Run It
- Decide where the description comes from: an RMM self-service button with a prompt, or your help desk typing it in.
- Set ProblemReportWebhook as a secure field only if you have an HTTPS receiver that accepts a zip.
- Run it with DryRun=true once to see the zip it would create.
Type and Risk
- Type: Action. It makes its change, checks the change worked and says what changed. It exits 0, or 2 when it could not do the job.
- Risk: Low. Set DryRun=true, or run it with -WhatIf, to list every change without making any.
- What it changes: Writes a zip under ProgramData\MSPOutpost\ProblemReports; deletes zips there older than KeepDays; optionally sends the zip to the webhook.
- Restart: It never restarts the machine.
- Typical run: Under 1 minute.
- Example answer: "Problem report problem-report-DESK-014-20261118-091500.zip saved (3 app errors); sent to the webhook"
- 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.
- Description: One line from the user about what is wrong, up to 500 characters. Default empty, which is recorded as "(no description given)".
- EventMinutes: How far back to read Application-log errors, in minutes. Whole number, 1 to 1440. Default 10.
- KeepDays: Reports older than this many days are deleted from the ProblemReports folder. Whole number, 1 to 3650. Default 30.
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.