Prerequisites
- Ensure that you have reviewed and understand the Agent installation prerequisites outlined - Scripted Agent Installation
- Ensure that you have reviewed and understand the Install Token and Agent ID Values -
https://support.getquickpass.com/hc/en-us/articles/360061942274-Export-Customers-List-Status-and-Agent-ID-s - Run the Powershell Command as 'Administrator'
- Review the Scripted Agent Installation KB Article to understand what each Powershell Parameter will do
https://support.getquickpass.com/hc/en-us/articles/4413576799639-Scripted-Agent-Installation - This process can be utilized via your RMM solution. For deploying through your RMM solution please take a look at this KB
https://support.getquickpass.com/hc/en-us/sections/8400847538967-Agent-Deployment-Automation or consult your vendor's documentation on how to push software remotely through their RMM agent.
Agent Deployment – Install Token and Agent ID ChangesAs of Agent version 6.5.3.1, the Agent ID parameter is optional: 1) Leave the Agent ID field blank, or 2) Enter the Customer name If the customer name is left blank or does not resolve (for example, due to a typo or duplicate customer names), the Agent will install as an Unassigned Agent. Unassigned Agents can be manually assigned to the appropriate customer from the CyberQP Dashboard. |
How to Edit and Execute script
- Run PowerShell ISE AS ADMINISTRATOR
- Click the New Script icon (Paper with Asterisks in top right corner)
- Paste the script below into the Text area prior to modification.
- You will want to modify lines 12 & 13 ($QPInstallTokenID = "InstallToken" & $QPAgentID = "AgentID") to include the static Tenant Install Token and the individual Customer's Agent ID.
- Please ensure to leave the open and closing quotes around those values.
- You will want to modify lines 12 & 13 ($QPInstallTokenID = "InstallToken" & $QPAgentID = "AgentID") to include the static Tenant Install Token and the individual Customer's Agent ID.
- Once Editing has been completed, run the script by clicking the "Play" button or press F5 on your keyboard.
NOTE: If you want to run the PowerShell script from command line and pass the variables as arguments, skip to PowerShell Script With Arguments
PowerShell Script
##Quickpass Installation PowerShell Script
# QuickPass installation PowerShell script to check and report on QuickPass Agent installation
# Created to allow inline specification of TenantID and AgentID, supporting multiple versions.
# Modified to ensure the path syntax works with all supported update scenarios, including killing stuck agents.
# Determine PowerShell version safely across PSv2 → PSv7+
if ($PSVersionTable -and $PSVersionTable.PSVersion) {
$PSMajorVersion = $PSVersionTable.PSVersion.Major
}
else {
# Fallback for extremely old shells (rare)
$PSMajorVersion = $Host.Version.Major
}
Write-Host "Detected PowerShell major version: $PSMajorVersion"
#Modify this value to specify the Download path for the installation file
$BasePath = "C:\QPInstall"
$DownloadURL = "https://storage.googleapis.com/qp-installer/production/Quickpass-Agent-Setup.exe"
# Use Join-Path for compatibility from PSv2 → PSv7+
$Output = Join-Path -Path $BasePath -ChildPath "Quickpass-Agent-Setup.exe"
#Edit These Values for your Install Token and Agent ID Inside quotation Marks
$QPInstallTokenID = "InstallToken"
$QPAgentID = "CustomerAgentID"
#Edit RegionID for EU or CA Data Center ONLY - NA is default if not specified
#RegionID = "EU" for EU Data Centre
#RegionID = "NA" for North America/Oceania Data Center
#RegionID - "CA" for Canada Data Centre
$RegionID = "NA"
#adds quotes to Installation Parameter
$QPInstallTokenIDBLQt = """$QPInstallTokenID"""
$QPAgentIDDBlQt = """$QPAgentID"""
$Region = """$RegionID"""
# Restart Options
<# restart="1." command="command" versions="versions" lower="lower" than="than" -="-" if="If" no="No" option="option" is="is" after="After" installation="installation" the="the" system="system" will="WILL" automatically="automatically" administrator="administrator" agent="Agent" complete="complete" and="and" not="NOT" be="be" rebooted="rebooted" or="or" higher="higher" already="already" occur="occur" unless="unless" explicitly="explicitly" forced="forced" with="with"#>
$RestartOption = "/NORESTART"
#MSA vs Local System Service Options
<# msa="1:" command="command" -="-" if="If" no="no" value="value" is="is" the="the" agent="Agent" service="Service" will="will" run="run" under="under" local="Local" system="System" a="A" managed="Managed" account="Account" be="be" created="created" and="and" used="used" to="to" this="This" option="option" domain-only="domain-only" exclusively="exclusively" in="in" domain="domain" all="All" other="other" values="values" are="are"#>
$MSAOption = "MSA=1"
# Get the .NET version
$VersionKey = "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"
$NetVersion = (Get-ItemProperty -Path $VersionKey).Version
# Test if download destination folder exists, create folder if required
if (Test-Path -Path $BasePath) {
Write-Host "Destination folder exists"
}
else {
Write-Host "Creating folder $BasePath"
New-Item -Path $BasePath -ItemType Directory -Force | Out-Null
}
#Begin Download of Agent file from Repository
Write-Host "Beginning download of the Quickpass agent"
$ProgressPreference = 'SilentlyContinue'
if ($PSMajorVersion -le 2) {
# =======================
# PowerShell 2 fallback
# =======================
Write-Host "Using .NET WebClient (PowerShell v2 compatible)"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($DownloadURL, $Output)
}
elseif ($PSMajorVersion -ge 7) {
# =======================
# PowerShell 7+ syntax
# =======================
Write-Host "Using Invoke-WebRequest (PowerShell 7+)"
Invoke-WebRequest -Uri $DownloadURL -OutFile $Output
}
else {
# =======================
# Windows PowerShell v3–v5
# =======================
Write-Host "Using Invoke-WebRequest (Windows PowerShell v3–v5)"
Invoke-WebRequest -Uri $DownloadURL -OutFile $Output -UseBasicParsing
}
#Write Variables and Notifications
write-host "Variables in use for Quickpass Agent installation"
write-host "Software Path: $Output"
write-host "Installation Token: $QPInstallTokenID"
write-host "Customer ID $QPAgentID"
write-host "Restart option Selected $RestartOption"
write-host "MSA Creation Selected $MSAOption"
# Kill processes with Installation or update of CyberQP
# Kill all existing processes running msiexec.exe
$processPatterns = @(
"*quickpass-agent*",
"*qpupdate*",
"msiexec"
)
foreach ($pattern in $processPatterns) {
Get-Process -ErrorAction SilentlyContinue |
Where-Object { $_.ProcessName -like $pattern } |
ForEach-Object { Stop-Process -Id $_.Id -Force }
}
write-host "Beginning installation of Quickpass"
#Run QP Agent download file
Try
{
Start-Process "$Output" -ArgumentList "/quiet $RestartOption INSTALLTOKEN=$QPInstallTokenIDBLQt CUSTOMERID=$QPAgentIDDBlQt REGION=$Region $MSAOption" -ErrorAction Stop
}
Catch
{
$ErrorMessage = $_.Exception.Message
write-host "Install error was: $ErrorMessage"
#exit 1
}
# Compare the .NET version with 4.7.2
if ([version]$NetVersion -lt [version]"4.7.2") {
# Display a message in Blue with Yellow Background
Write-Host "`n.NET version $NetVersion detected. The system will need a reboot to complete phase 1, at which time the installation will automatically continue." -ForegroundColor Blue -BackgroundColor Yellow
return
}
#Check if service is running
$serviceName = "Quickpass Server Agent"
$maxAttempts = 3
Start-Sleep -Seconds 20 # Wait for 20 seconds
$serviceStatus = Get-Service -Name $serviceName
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
if ($serviceStatus.Status -eq "Running") {
Write-Host "The service '$serviceName' is now running. Quickpass Agent should have been installed successfully"
break
}
elseif ($attempt -eq $maxAttempts) {
Write-Host "Service '$serviceName' failed to start. Confirm the variables 'QPInstallTokenID' and 'QPAgentID' are defined and try again, or check the error logs."
break
}
else {
Write-Host "Waiting for service '$serviceName' to start..."
Start-Sleep -Seconds 30
$serviceStatus = Get-Service -Name $serviceName
}
}
PowerShell Script With Arguments
To run the PowerShell script from command line and pass the variables as arguments, please use this PowerShell script.
How to Edit and Execute script
- Run PowerShell ISE AS ADMINISTRATOR
- Click the New Script icon (Paper with Asterisks in top right corner)
- Paste the script below into the Text area
- Save the file to the desired directory, i.e. C:\AgentInstallScripts or root C:\
- Click the New Script icon (Paper with Asterisks in top right corner)
- In the text area, enter the following (NOTE: Edit the path that the 'cd' command goes to depending on where you saved the PowerShell script in step #3.1):
cd C:\ ; .\QPInstall.ps1 '<installtoken>' '<agentid>' #edit 'cd C:\' path according to the location of the QPInstall.ps1 PowerShell script- Modify the <installtoken> and <agentid> to include the static Tenant Install Token and the individual Customer's Agent ID
- Please ensure to leave the open and closing single-quotes around those values
- If your QP Tenant is based in EU, add the parameter '-EU' to the end as shown below
cd C:\ ; .\QPInstall.ps1 '<installtoken>' '<agentid>' -EU #edit 'cd C:\' path according to the location of the QPInstall.ps1 PowerShell script
- Once editing has been completed, run the script by clicking the "Play" button or press F5 on your keyboard.
NOTE: If you wish to modify the $RestartOption and $MSAOption variables you may add additional arguments to the PowerShell script, then include those argument values to the command line script accordingly.
##Quickpass Installation PowerShell Script
Param(
[switch]$EU
)
$Path = "C:\QPInstall"
$DownloadURL = "https://storage.googleapis.com/qp-installer/production/Quickpass-Agent-Setup.exe"
$Output = $path + "\Quickpass-Agent-Setup.exe"
#Arguments to declare Install Token and Agent ID at run-time
$QPInstallTokenID = $args[0]
$QPAgentID = $args[1]
#Call for -EU parameter at run-time if EU tenant deploy
If ($EU) {
$RegionID = "EU"
} else {
$RegionID = "NA"
}
#adds quotes to Installation Parameter
$QPInstallTokenIDBLQt = """$QPInstallTokenID"""
$QPAgentIDDBlQt = """$QPAgentID"""
$Region = """$RegionID"""
#Restart Options
<#Restart Commands
.NET lower than 4.7.2
.NET 4.7.2 or Higher Already Installed
No value Specified
After installation of .NET completes the system will automatically be restarted & After admin login, installation of the Agent system will complete and system will NOT be rebooted
After installation of the Agent system will NOT be rebooted
/NORESTART
After installation of .NET completes the system will NOT automatically be restarted & After admin login, installation of the Agent will complete and system will NOT be rebooted
After installation of the Agent system will NOT be rebooted
/FORCERESTART
After installation of .NET completes the system will automatically be restarted & After admin login, installation of the Agent will complete and system will NOT be rebooted
After installation of the Agent system will NOT be rebooted
RESTART=1
After installation of .NET completes the system will automatically be restarted & After admin login, installation of the Agent will complete and system will be rebooted
After installation of the Agent system will be rebooted
#>
$RestartOption = "/NORESTART"
#MSA vs Local System Service Options
<#MSA Commands
No Value Specified
The Agent will use the Local System Account to run the service
MSA=0
The Agent will use the Local System Account to run the service
MSA=1
A Managed Service Account will be created to run the Service
NOTE: This is only used for Domain Controllers. All other system types this command will be ignored.
#>
$MSAOption = "MSA=1"
#Test if download destination folder exists, create folder if required
If(Test-Path $Path)
{write-host "Destination folder exists"}else{
#Create Directory to download quickpass installer into
write-host "Creating folder $Path"
md $Path
}
#Begin download of Quickpass Agent
write-host "Beginning download of the quickpass agent"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $DownloadURL -OutFile $Output -UseBasicParsing
write-host "Variables in use for Quickpass Agent installation"
write-host "Software Path: $Output"
write-host "Installation Token: $QPInstallTokenID"
write-host "Customer ID $QPAgentID"
write-host "Restart option Selected $RestartOption"
write-host "MSA Creation Selected $MSAOption"
write-host "Beginning installation of Quickpass"
#Run QP Agent download file
Try
{
Start-Process "$Output" -ArgumentList "/quiet $RestartOption INSTALLTOKEN=$QPInstallTokenIDBLQt CUSTOMERID=$QPAgentIDDBlQt REGION=$Region $MSAOption" -ErrorAction Stop
}
Catch
{
$ErrorMessage = $_.Exception.Message
write-host "Install error was: $ErrorMessage"
#exit 1
}
#Check if service is running
$serviceName = "Quickpass Server Agent"
$maxAttempts = 3
Start-Sleep -Seconds 20 # Wait for 20 seconds
$serviceStatus = Get-Service -Name $serviceName
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
if ($serviceStatus.Status -eq "Running") {
Write-Host "The service '$serviceName' is now running. Quickpass Agent should have been installed successfully"
break
}
elseif ($attempt -eq $maxAttempts) {
Write-Host "Service '$serviceName' failed to start. Confirm the variables 'QPInstallTokenID' and 'QPAgentID' are defined and try again, or check the error logs."
break
}
else {
Write-Host "Waiting for service '$serviceName' to start..."
Start-Sleep -Seconds 30
$serviceStatus = Get-Service -Name $serviceName
}
}
Troubleshooting
- Ensuring MSA enabled installation allows service to start.
https://support.getquickpass.com/hc/en-us/articles/17291924425111-Using-MSA-for-Agent-on-Domain-Controllers-Resolving-Inability-to-Start-Service
Comments
1 comment
PowerShell script modified to add the following:
- Check and Report for .NET Version
- Check and Kill stuck Quickpass Agent Updates
- 2nd Script created to allow for inline specification of TenantID and AgentID
Please sign in to leave a comment.