From e1a3c3627fad7ac016970f527cbdfd234bbc2ca2 Mon Sep 17 00:00:00 2001 From: "Alan Bishop [Huntress]" <109673875+Alan-Huntress@users.noreply.github.com> Date: Wed, 19 Nov 2025 08:41:16 -0500 Subject: [PATCH] Update InstallHuntress.dattormm.comstore.ps1 Datto script uses TagsKey instead of Tags, so that should be logged just in case there are invalid characters. Also moved the commands that log keys further up in the chain to make sure they're captured before Test-Parameters is run, this is needed to ensure we see the keys in the logs before the script gets to a part of the execution that can be stopped by invalid key formats. --- .../scripts/InstallHuntress.dattormm.comstore.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 b/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 index 3e3061e..5749d4f 100644 --- a/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 +++ b/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 @@ -104,7 +104,7 @@ $estimatedSpaceNeeded = 200111222 ############################################################################## # These are used by the Huntress support team when troubleshooting. -$ScriptVersion = "Version 2, major revision 8, 2025 Aug 1" +$ScriptVersion = "Version 2, major revision 8, 2025 Nov 19" $ScriptType = "PowerShell (Datto)" # variables used throughout this script @@ -1033,16 +1033,19 @@ function main () { $AccountKey = $AccountKey.Trim() $OrganizationKey = $OrganizationKey.Trim() - # check that all the parameters that were passed are valid - Test-Parameters - # Hide most of the account key in the logs, keeping the front and tail end for troubleshooting if ($AccountKey -ne "__Account_Key__") { $masked = $AccountKey.Substring(0,4) + "************************" + $AccountKey.SubString(28,4) LogMessage "AccountKey: '$masked'" - LogMessage "OrganizationKey: '$OrganizationKey'" - LogMessage "Tags: $($Tags)" + } else { + LogMessage "WARNING: Account key not found! Software install cannot occur without a valid account key!" } + LogMessage "OrganizationKey: '$OrganizationKey'" + LogMessage "Tags: $($Tags)" + LogMessage "TagsKey: $(TagsKey)" + + # check that all the parameters that were passed are valid + Test-Parameters # reregister > reinstall > uninstall > install (in decreasing order of impact) # reregister = reinstall + delete registry keys