How to Run PowerShell Scripts on a Schedule or Alert
Breeze RMM turns your team's folder of PowerShell scripts into a shared script library you can run on any device, put on a schedule, or fire automatically when an alert goes off.
3:00 Captions: English Open on YouTube
What's in the demo
- The Script Library: 7 partner-wide scripts in PowerShell, Bash and CMD, each with a category and its target operating systems (Windows, macOS, Linux), so one copy serves every client you manage
- The built-in System Script Library ("Import from Library"): 26 ready-made scripts, each with an Import button and an "Import into" organization picker
- Inside "Clean Up Disk Space": PowerShell, Target OS Windows, available to all organizations, and the code in a full editor
- Typed parameters: MinFreeGB (number, default 15) and EmptyRecycleBin (yes/no, default true) asked at run time, plus ClientName filled in from the device property org.name, which nobody is asked for
- Run it ad hoc: the Execute Script dialog shows Run As System, the parameters with their defaults, ClientName "Supplied automatically from org.name", and a device picker (devices or device groups, filter by site and status). Pick ACME-WS-014, Execute, Confirm Execute
- Breeze opens the device's Script Execution History. The demo machine has no live agent, so the new run shows "Queued — device offline", with a Stop button until the device checks in
- A finished run of the same script on that device: Completed, exit code 0, 47 s, run as System, and stdout from "free before cleanup: 6.8 GB" to "free after cleanup: 19.1 GB (recovered 12.3 GB)", with stderr empty
- Schedule it: Jobs → Create Automation, scope "All organizations (partner-wide automation)", named "Weekly disk cleanup — all clients", Schedule trigger with the Weekly Sunday preset (0 0 * * 0, "Every Sunday at midnight"), and a Run Script action. "If the device is offline" is set to Queue (default): the work waits for the next check-in and expires after 7 days
- Trigger it from an alert: a second automation, "Low disk space → run cleanup", with an Event trigger, Alert Triggered, severities Critical and High, monitor kind Disk usage, and the same Run Script action. Both jobs then show on the Jobs page, badged Partner-wide and enabled
Questions this video answers
- Can I run a PowerShell script on many devices at once in Breeze RMM?
- Yes. The Execute Script dialog lets you tick as many devices as you need, use Select all, or switch to Device groups. You can filter the list by site and status. The demo runs it on one workstation, and a partner-wide script can be run in any client organization you manage.
- Can script parameters be filled in automatically for each device?
- Yes. Set the parameter's source to "From a device property" and Breeze resolves it for every target device when the script runs. In the demo, ClientName is bound to org.name. The run dialog shows it as "Supplied automatically from org.name", and the script's output begins with "[Acme Manufacturing]". Other parameters, like a free-space threshold, are asked for at run time with a default.
- Can Breeze RMM run a script on a schedule?
- Yes. Under Jobs, create an automation with a Schedule trigger, either a cron expression or a preset such as Weekly Sunday, and a Run Script action. It can be partner-wide (All organizations) or limited to one organization. Devices that are offline get the run queued for their next check-in.
- Can an alert trigger a script automatically in Breeze RMM?
- Yes. Create a Jobs automation with an Event trigger set to Alert Triggered and narrow it by severity and monitor kind (Disk usage at Critical or High in the demo). Leave a group empty to match any value. The Run Script action runs on the device that raised the alert.
- Where do I see a script's output?
- Open the device and click a run in its Script Execution History. Execution Details shows the status, start and completion times, duration, exit code, run context, and the full stdout and stderr. A script's own Execution History lists its runs across devices.
A note on the demo: the lab machine has no live agent, so the ad-hoc run stays queued. The finished output shown afterwards is an earlier run of the same script recorded for that demo device. All organization and device names are fictional demo data.
Do this on your own fleet
Everything in the video is in the product you get. Start the Cloud Beta in minutes, or self-host the open-source Community edition for free.