From ba3d62807fd379d05c0676bb71dec65cf159b50f Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sat, 20 Dec 2025 23:17:55 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 71 +------------------------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index f759955..c856245 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1741,76 +1741,7 @@ function Invoke-InstallPrinters { #region Install-DattoRMM - <# -.SYNOPSIS - Installs/configures the Datto RMM agent, fetches site lists, and optionally saves the site list to disk. - -.DESCRIPTION - Centralizes Datto RMM operations in one function: - - Fetch API credentials from a webhook (-UseWebhook) - - Acquire OAuth token - - Fetch site list (-FetchSites) - - Save site list to Desktop as JSON or CSV (-FetchSites + -SaveSitesList) - - Write site variables to registry (-PushSiteVars) - - Download & launch the RMM agent installer (-InstallRMM) - - Save a copy of the installer (-SaveCopy) - -.PARAMETER UseWebhook - Fetches ApiUrl, ApiKey, and ApiSecretKey from the webhook when used with WebhookPassword. - -.PARAMETER WebhookPassword - Password for authenticating to the credentials webhook. - -.PARAMETER WebhookUrl - URL of the credentials webhook. Defaults to $Global:DattoWebhookUrl. - -.PARAMETER ApiUrl - Direct Datto API endpoint URL (if not using webhook). - -.PARAMETER ApiKey - Direct Datto API key (if not using webhook). - -.PARAMETER ApiSecretKey - Direct Datto API secret (if not using webhook). - -.PARAMETER FetchSites - Fetches the list of sites and skips all install steps. - -.PARAMETER SaveSitesList - Saves the fetched site list to Desktop using OutputFile. Must be used with -FetchSites. - -.PARAMETER OutputFile - Filename for saving the site list (.json or .csv). Defaults to 'datto_sites.csv'. - -.PARAMETER PushSiteVars - Writes fetched site variables into HKLM:\Software\SVS\Deployment. - -.PARAMETER InstallRMM - Downloads and runs the Datto RMM agent installer. - -.PARAMETER SaveCopy - Saves a copy of the downloaded agent installer to C:\Temp. - -.PARAMETER SiteUID - Unique identifier of the Datto site (required for install and registry push). - -.PARAMETER SiteName - Friendly name of the Datto site (used for logging). - -.EXAMPLE - # Fetch and save site list via webhook - Install-DattoRMM -UseWebhook -WebhookPassword 'Tndmeeisdwge!' -FetchSites -SaveSitesList -OutputFile 'sites.csv' - -.EXAMPLE - # Headless install with site variables - Install-DattoRMM -ApiUrl 'https://api.example.com' -ApiKey 'KeyHere' -ApiSecretKey 'SecretHere' \ - -SiteUID 'site-123' -SiteName 'Acme Corp' -PushSiteVars -InstallRMM - -.EXAMPLE - # Download and save installer to C:\Temp without installing - Install-DattoRMM -ApiUrl 'https://api.example.com' -ApiKey 'KeyHere' -ApiSecretKey 'SecretHere' \ - -SiteUID 'site-123' -SiteName 'Acme Corp' -SaveCopy -#> + function Install-DattoRMM { [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] param (