Question Locked

Scripting vs. RMM policies: where do you draw the line?

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
For routine workstation hygiene (disk cleanup, local admin pruning, agent health), what do you implement as portable scripts vs. native RMM policy objects? Post a small snippet or policy export and explain why it lives there.

4 replies

by Formik edited

RMM Policies – “Set and Forget”

Purpose: Automate ongoing, standardized configurations or checks across endpoints.

Best use cases:

Agent health monitoring

Scheduled antivirus scans

Disk quotas / usage alerts

Local admin pruning (with strict, standardized rules)

Enforcing OS or software configurations (e.g., Windows Update policies)

Reasoning: Policies are centrally managed, persistent, and typically don’t require frequent tweaks. They’re declarative rather than procedural.

Example – Windows Local Admin Pruning (RMM Policy):

# Policy managed via RMM
Get-LocalGroupMember -Group "Administrators" | Where-Object { $_.Name -notmatch "DOMAIN\\AdminGroup" } | Remove-LocalGroupMember -Member $_.Name

Why here: This is a repeatable, environment-wide standard task. Using the RMM policy ensures it’s automatically enforced on all endpoints and logs are collected centrally.

2. Portable Scripts – “Ad hoc or Specialized”

Purpose: Tasks that are one-off, environment-specific, or temporary.

Best use cases:

Ad-hoc cleanup (temp files, logs)

Fixing unique endpoint issues

Pre-deployment setup scripts

Advanced troubleshooting that doesn’t apply to all endpoints

Reasoning: Scripts are easier to modify and test, but don’t automatically propagate unless wrapped in a policy. They are procedural and often targeted to a subset of endpoints.

Example – Temporary Disk Cleanup (Script):

#!/bin/bash
# Linux workstation cleanup
rm -rf /tmp/*
rm -rf /var/tmp/*
find ~/Downloads -type f -mtime +30 -delete

Why here: It’s flexible, portable, and might only be needed occasionally. Wrapping it in an RMM policy could be overkill if it’s only for one-time cleanup.

by Ereun2006

I usually draw the line at “one-off logic” vs. “ongoing guardrails.” If it’s something like pruning stale local admins or forcing a weird registry tweak, I’ll keep it in a script so I can adjust fast and drop it where needed. Stuff like disk cleanup schedules, reboot cadence, AV health checks those live in RMM policies, since they’re more about consistency than creativity. Scripts are my scalpel, policies are my safety net.

by ethancarter199825

bro quick rule i follow
if it’s one-off or needs custom logic → script
if it’s repeatable check/fix with clear toggle in rmm → policy

ex cleanup temp files i drop in rmm policy cuz it’s same for all
but local admin prune i keep as script so i can run with args and log who was removed

by gracemiller8477 edited

For routine workstation hygiene, I typically use **native RMM policy objects** for recurring, low-risk tasks like disk cleanup schedules, temp file deletion, and agent health checks, since they’re built-in, centrally managed, and easily auditable. **Portable scripts** are reserved for one-off maintenance or deeper system tasks, such as pruning unused local admin accounts or repairing agent configurations, where custom logic or conditional handling is needed. For example, a PowerShell snippet like:

`powershell
Get-LocalUser | Where-Object { $_.Enabled -and $_.Name -ne 'Administrator' } | Remove-LocalUser
`

lives as a portable script so it can be version-controlled, reviewed, and run selectively without altering standard policy baselines.

This discussion is closed to new replies.