WIN-015 · Script
Inventory and Ticket API Connector
Collects a device inventory record, optionally with issue details for a ticket, and sends it as JSON to your HTTPS webhook or API.
What it does
Builds one JSON document describing the device: name, domain, manufacturer, model, serial number, BIOS, operating system and build, last boot and uptime, CPU, memory, disks, network adapters (IP and MAC addresses), signed-in user, and optionally the installed software list. If -IssueSummary is set, an "issue" section is added so the receiving system can open a ticket (for example a PSA, help desk or automation platform webhook).
Report mode (default) only writes the JSON to -ReportDir so you can check the content. Send mode also posts it to -WebhookUrl with Content-Type application/json. Only HTTPS addresses are accepted. The optional -BearerToken is sent as "Authorization: Bearer ..." and is never written to the log or the JSON file. Only the host name of the webhook is logged, in case the address itself contains a key.
The JSON layout is fixed and documented in the output (schema "runbookia.inventory/1"), so you can map its fields in the receiving system. Runs silently as SYSTEM. No prompts.
Requirements
Windows PowerShell 5.1+, run as SYSTEM or local admin. Outbound HTTPS to the webhook.
How to run it
- Run as: SYSTEM or a local administrator
- Run from: any RMM or MDM, Intune, a Group Policy startup script, a scheduled task, or an elevated PowerShell window
- Script type: PowerShell, 64-bit
- User interaction: none; the script never prompts
- Timeout: 10 minutes (30 for Windows Update installs)
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| Mode | Report (default) = save the JSON locally only. Send = save and post it to the webhook. | Report, Send | Report |
| WebhookUrl | HTTPS address that accepts a JSON POST, for example https://hooks.example.com/inventory. Required for Send. | ||
| BearerToken | Optional API token sent in the Authorization header. Never logged. | ||
| IssueSummary | Optional one-line issue title to include for ticket creation, for example "Disk almost full". | ||
| IssueDetails | Optional longer issue description. | ||
| IssuePriority | Optional priority label passed through as text, for example Low, Normal or High. Default Normal. | Normal | |
| Tags | Optional extra fields as name=value pairs, for example "client=Lincoln Elementary","site=Main". | (none) | |
| IncludeSoftware | Also include the installed software list (name, version, publisher). | False | |
| TimeoutSec | Seconds to wait for the webhook to answer. Default 30. | 30 | |
| RetryCount | Extra attempts when the post fails. Default 2. | 2 | |
| ReportDir | Folder for the JSON file. Default C:\ProgramData\Runbookia\Reports | C:\ProgramData\Runbookia\Reports |
Exit codes
- 0 = JSON saved (Report) or delivered (Send)
- 1 = Delivery failed after all retries, or the webhook returned an error
- 2 = Script error
Testing steps
- Run it first with the mode set to Report on one test device. Nothing is changed in that mode.
- Read the log and confirm the planned changes are what you expect.
- Run your chosen settings on the same test target and confirm the result.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Nothing on the device is changed. Send mode only posts a JSON record to your webhook; remove the record or ticket in the receiving system if it was sent by mistake.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |