You have the MSI installer (NightfallAgent.msi) provided by Nightfall.
Installation requires two properties:
API_KEY="YOUR-API-KEY"
COMPANY_ID="YOUR_SECRET_VALUE"
Installation is silent (/qn /norestart) and requires administrator rights.
Logging is enabled with /l*v for troubleshooting.
PowerShell: Local MSI (already copied to the machine)
Use this if you or your RMM tool place the .msi directly on the machine before running the script.
# Install-NightfallAgent-Local.ps1$msiPath="C:\Temp\NightfallAgent.msi"$apiKey="REPLACE_WITH_API_KEY"$companyId="REPLACE_WITH_COMPANY_ID"$logDir="C:\Windows\Temp\Nightfall"$logFile=Join-Path$logDir"NightfallAgent_Install.log"New-Item-ItemType Directory -Path $logDir-Force |Out-Nullif(Test-Path$msiPath){Write-Output"MSI found at $msiPath. Starting install..."$args="/i `"$msiPath`" API_KEY=`"$apiKey`" COMPANY_ID=`"$companyId`" /qn /norestart /l*v `"$logFile`""$proc=Start-Process"msiexec.exe"-ArgumentList $args-Wait -PassThru -NoNewWindowif($proc.ExitCode-eq0){Write-Output"Nightfall agent installed successfully."}else{Write-Output"Installer returned exit code $($proc.ExitCode). Check log: $logFile"exit$proc.ExitCode}}else{Write-Output"MSI not found at $msiPath. Skipping install."exit2}
PowerShell: Install from a Network Share
Use this if you keep the MSI on a file server. Make sure Domain Computers or the target machines have read access to the share.
⚠️ Use UNC paths (\\server\share\...) — mapped drives won’t work for GPO Startup scripts.
PowerShell: Download MSI from a URL
Use this if you host the MSI on an internal HTTPS server or CDN.
GPO Deployment via Startup Script
Recommended for domain-joined Windows machines. Use a Startup Script because the built-in “Software Installation” GPO cannot pass custom properties like API_KEY.
Steps:
Place the script (e.g., Install-NightfallAgent-FromShare.ps1) in
\\<domain>\SYSVOL\<domain>\scripts\Nightfall\
Ensure Domain Computers have read access.
In Group Policy Management:
Go to Computer Configuration → Policies → Windows Settings → Scripts (Startup/Shutdown).