Thank you for contributing. This document covers everything you need to know before submitting a new script or modifying an existing one.
Read HOWTO.md if you haven't already — it covers how scripts in this library are discovered and used by technicians, which will inform how you write and document your contribution.
All scripts follow the Action Product.ext pattern — a single approved verb followed by the thing being acted on, in Title Case.
Format: <Verb> <Target or Product>.<ext>
Approved verbs: Add, Audit, Cleanup, Configure, Create, Delete, Detect, Disable, Download, Enable, Enroll, Fix, Generate, Get, Import, Install, Migrate, Mitigate, PreStage, Promote, Rebuild, Remove, Repair, Run, Scan, Schedule, Set, Start, Sync, Uninstall
Examples:
Install ConnectSecure Agent.ps1 ✅
Get Mailbox Rules and Forwards.ps1 ✅
Cleanup Windows Update Cache.ps1 ✅
Mitigate CVE-2022-30190 Follina.ps1 ✅
Anti-patterns:
App - SomeApp Install.ps1 ❌ Category prefix
NinjaRMM_Removal_and_ReInstall.ps1 ❌ Underscores, multiple verbs
WS_SomeScript.ps1 ❌ Customer initials prefix
Use official product casing (BitLocker, FortiClient, NinjaRMM) and uppercase acronyms (SMB, CVE, UWP).
Every script must include the following, in order:
#Requiresstatement (if applicable — e.g.,#Requires -RunAsAdministrator)- Comment-based help block with at minimum
.SYNOPSIS,.DESCRIPTION, and.EXAMPLE(PowerShell) or equivalent header comment (Bash/Python) param()block — even if empty, to support future parameterization- Execution preferences —
$ProgressPreference = "SilentlyContinue"and similar for RMM scripts - NinjaOne environment variable overrides — map
$env:VARNAMEto parameters where applicable - Module/dependency checks — detect and install before use; never let a missing import kill the script
- Main logic wrapped in
try/catch - Explicit exit codes —
exit 0on success,exit 1(or non-zero) on failure
Before submitting, verify:
- No passwords, API keys, or tokens in the script body or comments
- No hardcoded tenant IDs, customer names, or domain names
- No hardcoded UNC paths or IP addresses that are customer-specific
- No credentials embedded in connection strings or URLs
- All runtime values come from parameters or
$env:variables
If any of these are present, remove them and parameterize before submitting. See SECURITY.md for the full policy.
Scripts deployed via NinjaOne run at SYSTEM level with no interactive session. They must:
- Never use
Read-Hostor any dialog that requires user input - Suppress progress bars:
$ProgressPreference = "SilentlyContinue" - Support configuration via
$env:VARIABLE_NAME(NinjaOne script variables / custom fields) - Exit with
exit 0/exit 1so Ninja can report success or failure
- Use
ExchangeOnlineManagementv3+ andMicrosoft.Graphonly - Never use
MSOnline,AzureAD,Connect-MsolService,Connect-AzureAD— these modules are end of life - If modifying an existing script that uses EOL cmdlets, replace them before submitting
Common replacements:
| EOL | Current |
|---|---|
Get-MsolUser |
Get-MgUser |
Set-MsolUser |
Update-MgUser |
Get-AzureADUser |
Get-MgUser |
Set-MsolUserLicense |
Set-MgUserLicense |
Use the folder structure below. If your script doesn't fit neatly, ask before creating a new folder.
| Folder | What belongs here |
|---|---|
Windows/Applications/ |
Install, uninstall, configure, or repair a Windows application |
Windows/CVE Mitigations/ |
Vulnerability detection or mitigation |
Windows/OS/Maintenance/ |
DISM, disk cleanup, index rebuild, hotfixes, licensing |
Windows/OS/Migration/ |
Entra ID prestage, Intune enrollment, profile migration |
Windows/OS/Networking/ |
Drive mapping, WakeOnLAN, NTP sync, offline files |
Windows/OS/Reporting/ |
Inventory, audit, and diagnostic reporting |
Windows/OS/Security/ |
BitLocker, UAC, SMB settings, credential caching, admin audits |
Windows/OS/User Management/ |
Profile cleanup, user creation, admin promotion, passwords |
Mac/Applications/ |
macOS agent or application install/uninstall |
Mac/OS/ |
macOS configuration and user management |
Mac/Security/ |
macOS security tooling and CVE detection |
Linux/Agents/ |
Linux agent installs |
Linux/Tools/ |
Linux diagnostic and utility scripts |
Microsoft 365/Exchange Online/ |
Mailbox, rules, contacts, distribution lists |
Microsoft 365/Entra ID/ |
Entra ID / Azure AD identity management |
Microsoft 365/Reporting/ |
M365 usage and compliance reporting |
Microsoft 365/Security and Compliance/ |
Phishing simulation, MFA reporting |
RMM/ |
NinjaOne agent management and configuration |
Datto/ |
Datto SaaS Protection and Endpoint Backup tooling |
IT Glue/ |
IT Glue export and import utilities |
Misc/ |
Standalone utilities that don't belong to a specific platform |
- Add your script to the appropriate folder.
- Confirm the filename follows the
Action Product.extconvention. - Complete the no-secrets checklist above.
- Update the folder
README.mdscript index. This is required — not optional. Add a row for any new script, remove the row for any deleted script, and update the name and description for any renamed script. The index must match the actual files in the folder at all times. - Add an entry to CHANGELOG.md under
[Unreleased]describing what was added, changed, or removed. - Open a pull request with a brief description of what the script does and why it was needed.
Questions? Reach out in the team Slack or open a draft PR to discuss before you finalize.