Installing the agent
The Printsluis Agent runs as a Windows service on a machine in your network. It collects print jobs from Printsluis over outbound HTTPS and prints them on your printers. This page is for the IT team that installs and maintains it.
What you need
Section titled “What you need”- Windows 10 or later, or Windows Server 2019 or later, x64. Nothing else: the agent brings its own .NET runtime.
- A local administrator account on that machine.
- The network access below.
- A pairing code: in the portal, Agents → Pair an agent. A code works once and expires after 15 minutes, so create it just before you install. Every machine needs its own code.
- The installer,
PrintsluisAgent-<version>-win-x64.msi. The portal’s pairing dialog links to it, and the latest version is always athttps://api.printsluis.nl/downloads/agent/latest/win-x64.
Network: firewall and proxy
Section titled “Network: firewall and proxy”The agent only makes outbound connections. Nothing connects to it, so no inbound ports are opened.
| From the agent’s machine to | Port | For |
|---|---|---|
api.printsluis.nl |
TCP 443 (HTTPS, TLS 1.2 or later) | Jobs, status, updates |
| Each network printer | TCP 9100 | Printing to network printers directly |
| Your proxy, if you have one | The proxy’s port | Outbound HTTPS through the proxy |
- Allow
api.printsluis.nlby host name, not by IP address. The host name never changes; the IP address may. - Give printers a fixed IP address or a DHCP reservation, so the agent keeps finding them.
- Proxy. A Windows service does not use the proxy settings of the person who installed it. If the network
needs a proxy, give it to the installer (
PROXYURL) or set it insettings.json(see Proxy and other local settings). - Proxy authentication. A proxy that asks for Windows authentication sees the machine’s computer account
(
DOMAIN\MACHINE$), because that is how the service account appears on the network. - TLS inspection. A proxy that inspects TLS must be trusted by the machine (its root certificate in the
machine’s Trusted Root store), or the agent refuses the connection.
diagnoseshows the certificate it got.
Install with the MSI
Section titled “Install with the MSI”The installer installs the agent to C:\Program Files\Printsluis\Agent, registers and starts the service,
pairs it when you give a pairing code, and ends with a connection check. It asks for administrator rights
(UAC) when it starts installing.
Interactive
Section titled “Interactive”Double-click the MSI. After the welcome page it asks for:
- the pairing code from the portal. Leave it empty to pair later from a command prompt, or to keep the current pairing when you upgrade;
- the gateway URL. Leave it empty: the default is
https://api.printsluis.nl; - the proxy URL, only if the network needs one.
Choose Install. The last page says where the connection check was saved. The agent shows as online in the portal within a minute.
Unattended
Section titled “Unattended”From a PowerShell prompt opened with Run as administrator, or from Intune, Configuration Manager or another deployment tool:
msiexec /i PrintsluisAgent-0.1.150-win-x64.msi /qn PAIRINGCODE=ABCD-2345 /l*v install.logUse the file name of the installer you downloaded. /qn installs without any dialog; /l*v install.log writes
a log that includes the output of every step.
msiexecreturns 0 when the install succeeded.- 1603 means it failed and was rolled back. Search the log for
install failed,Pairing withorReturn value 3to see why. - A pairing that fails, for example because the code expired, fails the whole install, so your deployment tool reports it.
For many machines at once, either create a code per machine, or install without PAIRINGCODE and pair each
machine afterwards:
cd "C:\Program Files\Printsluis\Agent".\PrintsluisAgent.exe pair ABCD-2345Installer properties
Section titled “Installer properties”| Property | What it does |
|---|---|
PAIRINGCODE |
The pairing code from the portal. Without it, the agent is installed unpaired, or keeps its current pairing. |
GATEWAYURL |
The Printsluis API to pair with. Default: https://api.printsluis.nl. You don’t need it. |
PROXYURL |
The outbound proxy, for example http://proxy.example.local:8080. Saved in settings.json. |
REMOVESTATE |
Only when uninstalling: REMOVESTATE=1 also deletes the agent’s keys and %ProgramData%\Printsluis. |
A property you don’t give changes nothing: an upgrade or repair without PROXYURL keeps the proxy that
settings.json has.
The pairing code is not written to an ordinary log, but a verbose log (/l*v) contains it. A code works once
and expires after 15 minutes, so the log is no risk once the install finished. Delete the log if the install
failed before pairing.
What gets installed
Section titled “What gets installed”| What | Where |
|---|---|
| Program files | C:\Program Files\Printsluis\Agent (PrintsluisAgent.exe). Only administrators can change them. |
| The agent service | PrintsluisAgent, delayed automatic start, restarted after a failure |
| The updater service | PrintsluisAgentUpdater (“Printsluis Agent Updater”); see Automatic updates |
| State | %ProgramData%\Printsluis: pairing, job journal, logs, local settings, downloaded updates |
| Event log | Source PrintsluisAgent in the Application log |
The service account
Section titled “The service account”The agent service runs as the virtual account NT SERVICE\PrintsluisAgent: no password to manage, not
LocalSystem and not an administrator. Its rights:
- Modify on the contents of
%ProgramData%\Printsluis. That folder is limited to SYSTEM, administrators and the service; ordinary users cannot read or add files there. - Read on the agent’s identity key in the machine key store.
- Its own user key store, where it keeps its encryption keys.
- Read and execute on
C:\Program Files\Printsluis\Agent, like every account.
On the network it appears as the machine’s computer account. For a printer installed in Windows, the service account must be able to print to that queue.
Keys and the identity fingerprint
Section titled “Keys and the identity fingerprint”Pairing creates the agent’s identity key, which it uses to authenticate to Printsluis. The service creates an encryption key for end-to-end encrypted documents, replaces it every 90 days, and signs it with the identity key. Both are non-exportable Windows (CNG) keys: they cannot be copied to another machine.
The identity key has a fingerprint, which applications can use to pin the agent:
Identity fingerprint: SHA256:A5BYxvLAy0ksUzsKTRTvd8wPeKvMztUofYShogEc+4Epair prints it, and diagnose shows it on its Identity line. Give it to the application’s developers if
they pin agents. Read it on the agent’s own machine, not from the portal. It changes only when the agent
pairs again.
Check the installation
Section titled “Check the installation”diagnose checks the installation step by step: the gateway URL, proxy, DNS, TLS, an HTTPS request, clock
skew, the pairing, the keys, every configured printer, the service and updates. It is the first thing to run
when something doesn’t work, and the first thing support asks for. Run it from a prompt opened with Run as
administrator, so it can read the agent’s key:
cd "C:\Program Files\Printsluis\Agent".\PrintsluisAgent.exe diagnoseLines marked FAIL are problems; exit code 0 means none were found. The installer runs it at the end of every
install and saves the report to %ProgramData%\Printsluis\diagnose.txt (open it from an elevated prompt:
notepad C:\ProgramData\Printsluis\diagnose.txt).
diagnose runs as you, but the service runs as its own account, which does not see your proxy settings. When
diagnose reports a system proxy, set ProxyUrl.
Proxy and other local settings
Section titled “Proxy and other local settings”Settings that must survive upgrades go in %ProgramData%\Printsluis\settings.json. The installer writes
PROXYURL here; you can also edit it by hand:
{ "Agent": { "ProxyUrl": "http://proxy.example.local:8080" }}Restart the service afterwards:
Restart-Service PrintsluisAgentWhen the installer saves a setting, comments in the file are not kept.
Printers
Section titled “Printers”After the agent is online, an admin adds its printers in the portal (Printers → Add printer):
- Network printer: host name or IP address and port 9100. The agent connects directly; no driver is needed. Best for Zebra label printers, because the agent then reads the printer’s own status (paper out, head open, paused) before and after each job.
- Windows printer: a printer installed on the agent’s machine, by USB or network. The agent lists the printers installed in Windows, so the portal can offer them. PDF documents always print through a Windows printer and its driver. For office network printers, install a TCP/IP, IPP or shared queue in Windows first.
Windows knows less about a printer’s state than the printer itself: a job the Windows queue holds (offline, paper out) becomes outcome unknown rather than succeeded. See Concepts.
To check a printer from the agent’s machine, without Printsluis:
.\PrintsluisAgent.exe printer status 10.0.0.50 --zpl # a Zebra on the network: Ready, PaperOut, HeadOpen, Paused, Unreachable….\PrintsluisAgent.exe printer test 10.0.0.50:9100 --zpl # status, a test label, status again.\PrintsluisAgent.exe printer status "spooler:ZDesigner ZD421-203dpi ZPL" # a printer installed in WindowsUse --zpl only for Zebra (ZPL) printers. Exit code 0 means ready, or printed and confirmed; 1 means the
printer needs attention or is unreachable.
Automatic updates
Section titled “Automatic updates”An agent installed with the MSI updates itself. Printsluis offers it the release it should run, and the agent and its updater service install it.
How it goes:
- The agent downloads the new release, and the one it runs now, from
api.printsluis.nl(the host name already allowed in the firewall), through its proxy. - It checks both against a manifest signed with the Printsluis release key, and their Authenticode signature (publisher Isatis Projects B.V.).
- It stops taking new jobs and waits until the job in progress is done: a job is never interrupted. If that takes longer than 10 minutes, printing resumes and it tries again 30 minutes later.
- The updater service checks everything again and runs the MSI unattended. The services stop for about a minute.
- If the new version doesn’t reach Printsluis within 10 minutes, the updater reinstalls the previous version, which resumes as the same agent.
The portal shows each step, and why an update failed.
The updater service, PrintsluisAgentUpdater, runs as LocalSystem, because installing an MSI needs it; the
agent’s own account cannot. It only installs an MSI that is in a signed manifest, is signed by Isatis Projects
B.V., is for this platform and is newer than the installed version (except when it rolls back an update that
failed). It makes no network connections itself. Its files are in %ProgramData%\Printsluis\updater, which
only SYSTEM and administrators can open; the msiexec log of each update is in
updater\runs\<time>-install-<version>\install.log.
Turning automatic updates off
Section titled “Turning automatic updates off”Either way, the portal then shows the agent as update by hand:
-
Disable the updater service. Takes effect within a minute:
Terminal window Stop-Service PrintsluisAgentUpdaterSet-Service PrintsluisAgentUpdater -StartupType DisabledAn upgrade or repair with the MSI installs the service again with automatic start, so do this again after upgrading by hand, or also use the setting below.
-
Or set
Agent:Updatestofalsein%ProgramData%\Printsluis\settings.json, which survives upgrades, and restart the agent:{ "Agent": { "Updates": false } }
To turn updates on again, set the service back to automatic, start it, and remove the setting. The Updates
line of diagnose shows whether updates are on, the updater service’s state and the last update’s result.
Upgrading by hand
Section titled “Upgrading by hand”Run the new MSI, interactively or unattended, without PAIRINGCODE:
msiexec /i PrintsluisAgent-0.1.160-win-x64.msi /qn /l*v upgrade.logThe installer stops the service, replaces the files and starts it again. The pairing, the keys, the job
journal, the logs and settings.json stay as they are, so the agent resumes as itself; jobs it was printing
are recovered from its journal. If the upgrade fails, Windows Installer rolls back to the old version.
An MSI older than the installed version refuses to install. To go back, uninstall first (which keeps the pairing), then install the older one.
The portal shows each agent’s version, and warns when an agent is outdated.
Pairing again
Section titled “Pairing again”To pair an agent again, for example with a new code after it was revoked, run pair with a new pairing code
from the portal:
cd "C:\Program Files\Printsluis\Agent".\PrintsluisAgent.exe pair ABCD-2345Pairing replaces the identity key and restarts the service, which creates a new encryption key. The fingerprint changes, so applications that pin the agent need the new one.
Uninstalling
Section titled “Uninstalling”In Settings → Apps (or Programs and Features), uninstall Printsluis Agent. Or, unattended:
$product = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object DisplayName -eq 'Printsluis Agent').PSChildNamemsiexec /x $product /qn /l*v uninstall.logThis removes both services and C:\Program Files\Printsluis, but keeps %ProgramData%\Printsluis and the
keys, so installing again resumes as the same agent.
To remove the agent completely, revoke it in the portal first, then uninstall with REMOVESTATE=1:
msiexec /x $product /qn REMOVESTATE=1 /l*v uninstall.logThis also deletes the agent’s keys and %ProgramData%\Printsluis: the pairing, the journal, logs, local
settings, the diagnose report and downloaded updates.
Troubleshooting
Section titled “Troubleshooting”The service does not start. Run diagnose: its Service line shows the state and the account. The agent’s
logs are in %ProgramData%\Printsluis\logs, and in Event Viewer → Windows Logs → Application, source
PrintsluisAgent. Windows logs service failures under Windows Logs → System, source “Service Control Manager”.
For a failed MSI install, the /l*v log has the output of every step. Logs never contain document content.
SmartScreen (“Windows protected your PC”) can appear when you start a downloaded installer from Explorer.
Choose More info → Run anyway, or unblock the file first (Unblock-File .\PrintsluisAgent-0.1.150-win-x64.msi).
msiexec from a command prompt doesn’t ask.
Application control or antivirus (AppLocker, WDAC, Defender for Endpoint) may block or quarantine the agent.
Signs: the install fails with “access denied” or “blocked by policy”, the service does not start, or files
disappear from the folder. Allow C:\Program Files\Printsluis\Agent\PrintsluisAgent.exe by path. A rule by file
hash breaks with every update.
The agent is offline in the portal. Check that the service runs (Get-Service PrintsluisAgent), then run
diagnose for DNS, proxy, TLS and clock problems.
Logs for support. An admin can request an online agent’s logs from the portal. The agent then sends its last three days of logs and a diagnose report within a minute, so you don’t have to collect them on the machine. They never contain document content, and are deleted after seven days.