Skip to content

Instantly share code, notes, and snippets.

@mark05e
Last active January 15, 2025 02:35
Show Gist options
  • Save mark05e/656c6062084580a4d18cec7a97ea9294 to your computer and use it in GitHub Desktop.
Save mark05e/656c6062084580a4d18cec7a97ea9294 to your computer and use it in GitHub Desktop.
# ref:
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Monitor/CustomComponentMonitor.htm
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/InputVariables.htm
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/Scripting.htm
# - https://dectur.com/datto-bitlocker/
# - https://www.cyberdrain.com/dattocon-resources/
# - https://rmm.datto.com/help/en/Content/4WEBPORTAL/Components/Scripting.htm?Highlight=Agent%20variables
# -
function write-DRRMAlert ($message) {
write-host '<-Start Result->'
write-host "Alert=$message"
write-host '<-End Result->'
}
function write-DRMMDiag ($messages) {
write-host '<-Start Diagnostic->'
foreach ($Message in $Messages){ $Message }
write-host '<-End Diagnostic->'
}
function write-DRMMUdf ($usrUDF, $message) {
if ([int]$env:usrUDF -and [int]$env:usrUDF -match '^\d+$') {
if ([int]$env:usrUDF -ge 1 -and [int]$env:usrUDF -le 30) {
New-ItemProperty -Path "HKLM:\SOFTWARE\CentraStage" -Name Custom$env:usrUDF -Value $message -Force | Out-Null
write-host "Value written to User-defined Field $env:usrUDF`."
} else { write-host "User-defined Field value must be an integer between 1 and 30." }
} else { write-host "User-defined field value invalid or not specified - not writing results to a UDF." }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment