pub enum RunAs {
System,
User,
SystemGui,
}Expand description
Token + session combination the agent uses to spawn a job’s child process. Two orthogonal axes — whose privileges and which session — collapse into three meaningful combinations:
| variant | session | privileges | GUI |
|---|---|---|---|
System (default) | Session 0 (services) | LocalSystem | ❌ |
User | active console session | logged-in user (UAC-filtered when admin) | ✅ |
SystemGui | active console session | LocalSystem | ✅ |
SystemGui is the “PsExec -i -s” pattern: the agent duplicates
its own SYSTEM token and rewrites TokenSessionId to the user’s
console session, then launches with that hybrid token — useful
when an installer needs admin power and needs the user to see
its UI.
Variants§
System
LocalSystem privileges in Session 0. No GUI. Historical default — every pre-v0.21 job ran this way.
User
The currently-logged-in console user’s identity, in their session. Can write HKCU / %APPDATA% / show GUI to the user. Privileges are whatever the user has (admin users get the UAC-filtered limited token, not the elevated one).
SystemGui
LocalSystem privileges in the user’s session — admin power with GUI visibility. Niche but real (force-restart dialogs, admin installers with progress UI).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunAs
impl<'de> Deserialize<'de> for RunAs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for RunAs
impl JsonSchema for RunAs
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more