Datto RMM Deployment Component - Site/Organization Override
M
Michael McCool
There are instances where the Datto RMM site name may be different than the organization in Huntress. In these instances, instead of manually moving the endpoints in the Huntress portal, it would be better to have the ability to change the org name used by the deployment script.
-------------------------------------------------------------------------
# Use the CS_PROFILE_NAME environment variable as the OrganizationKey
# This should always be set by the DattoRMM agent. If not, there is likely
# an issue with the agent.
$OrganizationKey = $env:CS_PROFILE_NAME
if (!$env:CS_PROFILE_NAME) { $OrganizationKey = 'MISSING_CS_PROFILE_NAME' }
#
#
# If the site override variable is set, use this for the org name instead.
if ($env:HUNTRESS_SITE_OVERRIDE) {
LogMessage "Overriding site name."
$OrganizationKey = $env:HUNTRESS_SITE_OVERRIDE
}
----------------------------------------------------------------------------
The second section here is my addition to the script with the use of the $env:HUNTRESS_SITE_OVERRIDE variable. This section would allow the script to work as it exists currently if the value is not configured, but be modified to the value set as a site variable in Datto RMM if you need to make sure that endpoints in the RMM site are linked to a different Huntress Organization than the Datto RMM site name. This is needed for some organizations have multiple RMM sites or co-managed companies but are all technically the same. This is mainly for ITDR where multiple RMM sites would fall under the same company in 365. There are also occasions where a client may have an unique identifier in the RMM that should not be used elsewhere. The HUNTRESS_SITE_OVERRIDE value allows for configuring a sanitized value that should be used instead.