Last active
January 15, 2025 02:35
-
-
Save mark05e/656c6062084580a4d18cec7a97ea9294 to your computer and use it in GitHub Desktop.
Maintenance Note - https://gist.github.com/mark05e/0a04a54c1e8489c770bd91e4910d7df9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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