Skip to content

aybouzaglou/Datto-RMM-Powershell-Scripts

Repository files navigation

Datto RMM PowerShell Scripts

Ask DeepWiki

PowerShell scripts for Datto RMM with embedded functions for easy maintenance and deployment.

Quick Start

Task Location Documentation
Find scripts components/ Component Categories
Create scripts templates/ Templates
Copy functions shared-functions/ Function Reference
Deploy Direct paste to RMM Deployment Guide
Download files Modern patterns Download Best Practices

Key Features

  • Flexible Architecture: Support for both embedded functions and standard module imports.
  • Direct Deployment: Scripts are designed to be deployed directly to Datto RMM components.
  • Standardized Logging: Consistent logging using Write-RMMLog (or Write-Host for Monitors).

Architecture

Scripts can use embedded functions for easy maintenance or standard PowerShell modules where appropriate.

# Example embedded function (copied from shared-functions/)
function Write-RMMLog {
    param([string]$Message, [string]$Level = 'Info')
    Write-Output "[$Level] $Message"
}

Key Principles

  • Copy functions from shared-functions/ library (for maintainability)
  • Create custom functions when shared functions don't fit your needs
  • Use PowerShell modules (Import-Module) when appropriate
  • Download installers/resources from vendors (Adobe, Microsoft, etc.)
  • Avoid launcher scripts that pull other scripts from external sources (GitHub wikis, etc.)

Monitor Output Contract (Critical)

For Datto RMM Custom Monitors, output must follow this exact contract so RMM parses results reliably:

  • Use Write-Host exclusively (no Write-Output/Write-Verbose)
  • Emit exactly one diagnostic section:
    • "<-Start Diagnostic->" ... "<-End Diagnostic->"
  • Emit exactly one result section immediately after diagnostics:
    • "<-Start Result->"
    • A single line beginning with "Status=..."
    • "<-End Result->"
  • Exit code: 0 for OK, non-zero for alert states

Minimal example:

# Diagnostics
Write-Host '<-Start Diagnostic->'
Write-Host 'My Monitor: running checks...'
Write-Host '<-End Diagnostic->'

# Results (single line)
Write-Host '<-Start Result->'
Write-Host 'Status=OK: All checks passed'
Write-Host '<-End Result->'
exit 0

Recommended helper pattern (centralized):

function Write-MonitorAlert { param([string]$Message)
  Write-Host '<-End Diagnostic->'
  Write-Host '<-Start Result->'
  Write-Host "Status=$Message"
  Write-Host '<-End Result->'
  exit 1
}

function Write-MonitorSuccess { param([string]$Message)
  Write-Host '<-End Diagnostic->'
  Write-Host '<-Start Result->'
  Write-Host "Status=$Message"
  Write-Host '<-End Result->'
  exit 0
}

Repository Structure

components/
├── Applications/    # Software deployment scripts
├── Monitors/        # System monitoring scripts
└── Scripts/         # General automation scripts

shared-functions/    # Function patterns to copy/paste
templates/          # Script templates
docs/              # Documentation

Available Scripts

Applications

  • ScanSnapHome.ps1 - ScanSnap Home installation

Scripts

  • FocusedDebloat.ps1 - Windows bloatware removal
  • Setup-TestDevice.ps1 - Test device configuration

Templates

  • SelfContainedApplication-Template.ps1 - Application script template
  • SelfContainedScript-Template.ps1 - General script template
  • DirectDeploymentMonitor-Template.ps1 - Monitor script template

Usage

  1. Copy script content from components/
  2. Paste directly into Datto RMM component
  3. Set environment variables as needed
  4. Deploy

Developer Documentation

Start new work by reviewing the core guides in docs/ so your scripts align with the project conventions:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published