Datto RMM Deployment Component - Device Correlation - Use Datto RMM DeviceID as tag
M
Michael McCool
When attempting to correlate the devices in the Huntress portal against the devices in Datto RMM that show Huntress is installed, there is a disconnect. It's impossible to have a 1:1 correlation between the two portals.
If I have 800 devices in Datto RMM that show Huntress is installed, and the Huntress portal shows 810 devices, how do I reconcile that? It's impossible to handle programmatically. Manually reviewing orgs and devices doesn't scale. There needs to be a way to quickly reconcile the two platforms and confirm with 100% certainty which devices in one platform link with the other. The absolute best way to handle this is to utilize Datto RMM's device ID as a tag during the installation process. This tag would get saved in the Huntress portal and would identify each device uniquely.
From here, we could run a script against the APIs of both platforms and easily identify which devices don't match, which have duplicates and which might require further investigation.
To make this work, I've added a bit of code to the Tags script section to extract the Datto RMM Device ID from the local registry on the device and append it to any existing tags that might be configured. It might be best to have this configured optionally as a component variable as not everyone would want to use it, but it would be best to have this option enabled by default. Anyone who doesn't find it useful hasn't tried to reconcile the device lists in their various platforms yet.
Here is the code that I'm using currently:
$TagsKey = "__TAGS__"
if ($env:HUNTRESS_TAGS) {
$TagsKey = $env:HUNTRESS_TAGS
}
#
# Below is my added portion
$DRMMDeviceID=Get-ItemPropertyValue "HKLM:\SOFTWARE\CentraStage" -Name "DeviceID"
if (([string]::IsNullOrWhiteSpace($TagsKey)) -or ($TagsKey -eq "__TAGS__")){
$TagsKey="DRMM:$DRMMDeviceID"
}
else{
$TagsKey=$TagsKey + ",DRMM:$DRMMDeviceID"
}
Since every endpoint agent added to the Huntress portal will have the Datto RMM DeviceID (unique value) added as a tag, it becomes possible to have a 1:1 correlation between the two platforms and have 100% accuracy in matching the devices between each portal.