Prerequisites
- 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 consult your vendor's documentation on how to push software remotely through their RMM agent.
PowerShell Script
##Quickpass Installation PowerShell Script
$Path = "C:\QPInstall"
$DownloadURL = "https://storage.googleapis.com/qp-installer/production/Quickpass-Agent-Setup.exe"
$Output = $path + "\Quickpass-Agent-Setup.exe"
#Edit These Values for your Install Token and Agent ID Inside quotation Marks
$QPInstallTokenID = "InstallToken"
$QPAgentID = "AgentID"
#Edit RegionID for EU Tenant ONLY
#RegionID = "EU" for EU Tenant
#RegionID = "NA" for North America/Oceania Tenant
$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"
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 = 2
$serviceStatus = Get-Service -Name $serviceName
start-Sleep -seconds 30
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
if ($serviceStatus.Status -eq "Running") {
Write-Host "Quickpass Agent should have been installed successfully and the service '$serviceName' is running."
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
}
}
Comments
0 comments
Please sign in to leave a comment.