Examples
banshee/examples-collection/examples/protocols/
winrm-run
Example: winrm.run, a PowerShell script over WinRM; the state of a Windows service.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Protocol: winrm.run
winrm.run runs a PowerShell script on a Windows, by WinRM over HTTPS, and returns output, errors and exit, as ssh.run does. Here, the state of the print spooler.
How to read it
need('protocol:winrm')is required bywinrm.run: the address, the account and its password, the port (5986), the delay, the fingerprint and the TLS profile, all set in the tree.- WinRM starts PowerShell itself: the script is written as it is, without the
powershell -Command "…"an SSH command to Windows needs. - The certificate of the WinRM service is judged before the account is sent; the password itself never leaves the poller (NTLM).
- What the script does on the host is the author's judgement: use an account without write rights.
To adapt it
- Another service: change
Spoolerfor its name (Get-Servicelists them). - The Windows collection holds each of its collectors by WinRM and by SSH, the same scripts.