MSP TOOLKIT

Free Tools Built by MSPs, for MSPs

Practical scripts, health checks, and automation tools designed by managed service providers who understand the daily grind. Download, deploy, and keep your clients' environments running smoothly.

🛠
MSP RESOURCES

Available Tools

Free, open-source scripts and utilities for MSPs. No signup required—just download and deploy.

POWERSHELL · CONNECTWISE AUTOMATE

OneDrive Health Check

A comprehensive PowerShell script that runs as SYSTEM via ConnectWise Automate. For every logged-on user, it validates OneDrive for Business sync health without touching user files or making network calls.

✅ What It Checks

  • ▶ OneDrive.exe is running in the user session
  • ▶ Business account is signed in
  • ▶ Known Folder Move (Desktop, Documents, Pictures)
  • ▶ Last data change timestamp inside OneDrive
  • ▶ Files saved outside OneDrive (wrong location)
  • ▶ Client log heartbeat (hung detection)
  • ▶ Folders redirected to a network share (not in OneDrive)

🔒 Security & Privacy

  • ▶ Zero network calls — fully offline
  • ▶ No credentials or secrets used
  • ▶ Never outputs file names or user data paths
  • ▶ Only reads file metadata, never opens files
  • ▶ Optional email masking with -MaskEmail
  • ▶ Auto-relaunches in 64-bit if needed
  • ▶ Errors reported as one clean line, paths stripped

⚙ Output & Exit Codes

Status line: ODSTATUS=OK | WARN | FAIL | NOUSER | ERROR

Exit codes: 0 = OK/NOUSER • 1 = WARN • 2 = FAIL • 3 = ERROR (the check itself could not complete — treat like FAIL)

Issue codes: NOT_RUNNING, NOT_SIGNED_IN, FOLDER_MISSING, KFM_OFF, NET_REDIRECT, STALE_<n>d, EMPTY, SCAN_LIMIT, LOCAL_SAVES, HUNG_<n>d, NO_LOGS, NO_PROFILE

Example: ODSTATUS=WARN | AzureAD/JRogan: KFM_OFF(Desktop,Documents) LOCAL_SAVES | Last=2026-11-20

Use -SingleLine for ConnectWise Automate Extra Data Fields (SQL-safe, max 250 chars).

💻 Usage Examples

# Basic health check
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\OneDriveHealthCheck.ps1

# Custom thresholds + event logging
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\OneDriveHealthCheck.ps1 -StaleDays 30 -RequireKFM -WriteEventLog

# Single-line output for Automate EDF
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\OneDriveHealthCheck.ps1 -SingleLine

# Recommended parameters for ConnectWise Automate (Execute Script step)
-SingleLine -MaskEmail -WriteEventLog
⬇ Download OneDriveHealthCheck.ps1

PowerShell 5.1+ • Runs as SYSTEM • No dependencies • MIT-style free to use

📄 Automate deployment guide (README)  •  🔑 SHA256SUMS.txt

SHA-256: 04ad2634931913dc6ab6cb59f0b6610b399a1693fc66dd15fbd1e45306015398  (version 2026-11-26c)

🔏 Verify Before You Run

Check the download matches the published hash before running it or pasting it into Automate. Run this in PowerShell from the folder you saved it to — it should print OK - hash matches.

$expected = '04ad2634931913dc6ab6cb59f0b6610b399a1693fc66dd15fbd1e45306015398'
$actual   = (Get-FileHash .\OneDriveHealthCheck.ps1 -Algorithm SHA256).Hash
if ($actual -eq $expected) { 'OK - hash matches' } else { "MISMATCH - do not run. Got $actual" }

Verify before editing: re-saving the file in an editor that changes line endings will change the hash. Each new release gets a new hash, published here.

REFERENCE

Script Parameters

Parameter Default Description
-StaleDays30Flag if no OneDrive changes in this many days
-LocalFileGraceDays7Flag local Desktop/Documents saves within this window
-HeartbeatDays3Flag if client hasn’t written a log in this many days
-MaxFilesToScan250,000Safety limit for folder scan
-MaxScanSeconds180Time limit for the scan
-RequireKFMswitchTreat missing KFM as FAIL instead of WARN
-MaskEmailswitchPartially mask account emails in output
-WriteEventLogswitchWrite result to Windows Application event log
-SingleLineswitchOutput one SQL-safe line for Automate EDFs
-MaxLength250Max chars for SingleLine output

Have a Tool Idea? Let’s Build It.

We’re always looking for automation opportunities. If you have a script or tool idea that would help the MSP community, reach out and let’s make it happen.

Get in Touch →
Build 11.26.26.b