Purpose
This article outlines a process in Datto RMM that allows you to track and monitor the unique identifier assigned to the QP Agent.
Once implemented, you can easily filter your machines in Datto RMM to pull up all that are linked to a specific QP Agent ID.
Initial Setup
1. Navigate to Datto RMM.
2. Click into Setup > Global Settings.
3. Scroll down to User-Defined Fields and adjust the 'User-defined field 1' Global Label to 'QP Agent ID' (customize as desired).
4. Click into Site > [site name] > Devices > Column Chooser, and click the QP Agent ID column under User-defined fields to add that UDF as a column.
Script Setup
The QP Agent ID unique identifier is stored as a registry key on the host machine. For Datto RMM to populate a UDF with a registry value, a REG KEY must be created somewhere the Datto agent can read.
This script will check that the QP Agent ID unique identifier registry key is populated, and then create a new REG KEY with that value so the Datto RMM agent can read the value and write it to the UDF. After a value has been read and written to a Datto RMM UDF, the REG KEY will be auto-removed from the registry tree.
1. Navigate to Datto RMM.
2. Click into Automation > Components > Create Component.
3. Assigned Name and Description as desired.
4. Set the Category to Scripts and Script language to PowerShell.
5. Copy the PowerShell script below and paste into the Datto RMM script box (Script attached as .ps1 file, see the bottom of the KB).
# Specify the registry key path
$registryKeyPath = "HKLM:\SOFTWARE\Quickpass Identifier\Quickpass Agent Id"
# Specify the name of the registry value
$valueName = "QpUniqueAgentId"
# Initialize a variable to store the registry value
$registryValue = $null
# Get the value of the registry key
try {
$registryValue = Get-ItemProperty -Path $registryKeyPath -Name $valueName -ErrorAction Stop | Select-Object -ExpandProperty $valueName
Write-Host "The value of '$valueName' in '$registryKeyPath' is: $registryValue"
} catch {
Write-Host "Error: $_.Exception.Message"
}
# Confirm the $registryValue contains a value / Create a new REG KEY for the Datto Agent to read and write to the UDF
if ($registryValue -ne $null -and $registryValue -ne "") {
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\CentraStage /v Custom1 /t REG_SZ /d "$registryValue" /f
} else {
Write-Host "No value to create a new registry key."
}
6. Select the Site you want the Component to target, for example: All Sites.
7. Scroll to the bottom, click Create Component.
Script Deploy
1. Click into Automation > Components > select the checkbox for the new Component > Create a Job.
2. Name as desired.
3. Click Add Target to select the desired target.
4. Under Schedule, set to run once or on a schedule.
5. Under Notification, define notification options as desired.
6. Under Execution, set to run as system (change if desired).
7. Click Create Job
8. Click into Automation > Jobs to find the created job and monitor as it runs.
9. To confirm the Job ran as desired, navigate to All Sites > [your sit name] > Devices
to view the devices with the QP Agent ID column visible:
Comments
0 comments
Please sign in to leave a comment.