winrm_exec
Run PowerShell commands on remote Windows hosts through WinRM without an SSH server or agent on the target. Captures stdout and stderr securely in-process using Invoke-Command.
Instructions
Run a command on a remote Windows host via PowerShell Remoting (WinRM / Invoke-Command). Native to Windows Server — no SSH server or agent needed on the target, only WinRM enabled. Output captured in-process (no console window).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"computerName": "<computerName>",
"command": "<command>"
},
"name": "winrm_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | Keep last bytes rather than first; incomplete UTF-8 boundary scalars are omitted. | |
| useSsl | No | Use HTTPS/5986 WinRM. | |
| command | Yes | PowerShell command/scriptblock body to run remotely. | |
| password | No | Credential password. | |
| username | No | Credential username (DOMAIN\\user or host\\user). Omit to use the host process identity. | |
| logOutput | No | Opt in to private file-backed raw output logs; may include secrets emitted by command. | |
| timeoutMs | No | Hard timeout in ms (default 120000). | |
| parameters | No | JSON-safe named remote script parameters; delivered through protected WinRM stdin payload. | |
| computerName | Yes | Remote Windows host name or IP. | |
| credentialRef | No | Operator-provisioned scoped credential reference, exclusive with raw auth. | |
| logQuotaBytes | No | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. | |
| authentication | No | WinRM auth mechanism. | |
| maxOutputBytes | No | Raw UTF-8 bytes per stream (default 1 MiB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log | No | ||
| detail | Yes | ||
| stderr | Yes | ||
| stdout | Yes | ||
| target | Yes | ||
| exitCode | Yes | ||
| timedOut | Yes | ||
| transport | Yes | ||
| durationMs | Yes | ||
| truncation | Yes | ||
| executionId | Yes | ||
| errorRecords | No | ||
| schemaVersion | Yes | ||
| terminationStatus | Yes | ||
| terminationCertainty | Yes | ||
| errorRecordsTruncated | No |