Agent Environments
A reference for the environment variables available to Blueprints, for both the Service Agent and the User Agent contexts.
Agent Environments
The K12Panel Agent exposes a set of environment values you can use in Blueprints by referencing $env:VARIABLENAME. The exact values can differ from machine to machine depending on configuration.
There are two execution contexts, and several variables differ between them. The Service Agent runs in service (system) space, so user-profile paths point at the system profile. The User Agent runs in the logged-in user’s context, so those paths point at that user’s profile.
Service Agent Environment (selected variables)
User Agent Environment (selected variables)
Both contexts also expose the standard Path, PATHEXT, PSModulePath, PSExecutionPolicyPreference, and processor identifier/level/revision values.
Common Questions
How do I use an environment value in a Blueprint?
Reference it as $env:VARIABLENAME — for example $env:COMPUTERNAME.
Why do APPDATA and USERPROFILE differ between agents?
The Service Agent runs in system space (system profile paths); the User Agent runs in the logged-in user’s context (their profile paths).
What is USERNAME in the Service Agent?
The machine account, shown as MachineHostName$.
Can the values vary by machine?
Yes. They reflect each machine’s configuration, so treat the values above as typical, not guaranteed.