Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Powershell script - Update your PDQ Keys

If you are like me, and you have many installations of PDQ Deploy and/or Inventory, you need to update the keys everywhere. As opposed to going through the GUI to input your new license key, I have written a Powershell script to install the keys automatically. All you need to do is replace INVENTORYKEYCODEHERE and DEPLOYKEYCODEHERE with your new codes, then run the script. If you only have one program installed, then adjust $programNames and $newKey to specify what you have.

$programNames = @("PDQ Inventory", "PDQ Deploy")
Write-Host "Stopping PDQ Services..."

ForEach ($programName in $programNames) {
Stop-Service -DisplayName $programName -Force
}

Write-Host "Installing new keys..."
$registryPath = "HKLM:\Software\Admin Arsenal\"
$newKey = @("--- START LICENSE ---INVENTORYKEYCODEHERE--- END LICENSE ---",
"--- START LICENSE ---DEPLOYKEYCODEHERE--- END LICENSE ---")
ForEach ($programName in $programNames) {
$index = [array]::indexof($programNames, $programName)
$path = (Join-Path -Path $registryPath -ChildPath $programName)
New-ItemProperty -Path $path -Name "License" -Value $newKey[$index] -PropertyType String -Force | Out-Null
}

Write-Host "Starting PDQ Services..."
ForEach ($programName in $programNames) {
Start-Service -DisplayName $programName
}
0

Comments

0 comments