Library / Windows endpoint

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.

Version 1.0.0Language PowerShellUpdated November 2026

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

NameWhat it doesOptionsDefault
ModeReport (default) = save the JSON locally only. Send = save and post it to the webhook.Report, SendReport
WebhookUrlHTTPS address that accepts a JSON POST, for example https://hooks.example.com/inventory. Required for Send.
BearerTokenOptional API token sent in the Authorization header. Never logged.
IssueSummaryOptional one-line issue title to include for ticket creation, for example "Disk almost full".
IssueDetailsOptional longer issue description.
IssuePriorityOptional priority label passed through as text, for example Low, Normal or High. Default Normal.Normal
TagsOptional extra fields as name=value pairs, for example "client=Lincoln Elementary","site=Main".(none)
IncludeSoftwareAlso include the installed software list (name, version, publisher).False
TimeoutSecSeconds to wait for the webhook to answer. Default 30.30
RetryCountExtra attempts when the post fails. Default 2.2
ReportDirFolder for the JSON file. Default C:\ProgramData\Runbookia\ReportsC:\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

  1. Run it first with the mode set to Report on one test device. Nothing is changed in that mode.
  2. Read the log and confirm the planned changes are what you expect.
  3. Run your chosen settings on the same test target and confirm the result.
  4. Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
  5. 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

VersionDateChanges
1.0.0November 2026First release.