Agent cmdlets (PowerShell)

For administrators. As of September 2026 (agent 1.0.36). Related guides: Client agent: operations, rollout and group policies, Quick Admin Guide, Devices without a domain (API key), Known issues.


1. Module and prerequisites

The ZeroPortalAgent module is installed with the agent and loads automatically as soon as you call one of its cmdlets; no Import-Module is needed. It requires Windows PowerShell 5.1, which ships with every Windows.


2. Managing publishing servers

The local server list. A list delivered by group policy replaces it completely.

Cmdlet Parameters Purpose
Add-ZPAgentPublishingServer -Name <text> (pos. 0), -Url <text> (pos. 1) Append a server. The order is the priority
Get-ZPAgentPublishingServer — All servers with ServerId, Name, BaseUrl, GlobalRefreshEnabled, UserRefreshEnabled, RequestTimeoutSec
Set-ZPAgentPublishingServer -ServerId <number> (pos. 0, required), -Name, -Url, -GlobalRefreshEnabled <bool>, -UserRefreshEnabled <bool>, -RequestTimeoutSec <number> Change one entry
Remove-ZPAgentPublishingServer -ServerId <number> or -Name <text> Delete entries
Add-ZPAgentPublishingServer -Name 'ZeroPortal' -Url 'https://zeroportalserver:8888'
Get-ZPAgentPublishingServer
Set-ZPAgentPublishingServer -ServerId 1 -UserRefreshEnabled $false

3. Reading and writing configuration

Settings live in four areas: MSIX, AppV, Agent and Policy. Every setting is a parameter of its own; the area switches narrow the output.

Cmdlet Parameters Purpose
Get-ZPAgentConfiguration -MSIX, -AppV, -Agent, -Policy, plus one switch per setting Effective values as a list: Name, Value, SetByGroupPolicy, Area
Set-ZPAgentConfiguration one typed parameter per setting, or -MSIX @{…}, -AppV @{…}, -Agent @{…}, -Policy @{…} Write values machine-wide (HKLM)
Set-ZPAgentDisplayName -Name <text> (pos. 0, required), -Scope User\|Machine Label shown in the portal. User (default) needs no admin rights, Machine names the device
Get-ZPAgentConfiguration -Policy
Get-ZPAgentConfiguration -SyncIntervalMinutes
Set-ZPAgentConfiguration -SyncIntervalMinutes 30
Set-ZPAgentConfiguration -Agent @{ LogLevel = 'Debug'; SyncJitterMinutes = 5 }
Set-ZPAgentDisplayName -Name 'Till 3' -Scope Machine

An unknown name fails with an error that lists the valid names. The full list of settings with their defaults is in Client agent: operations, rollout and group policies, section 6.


4. Turning sync areas on and off

After installation, all three areas are off.

Cmdlet Parameters Purpose
Enable-ZPAgentSync -Msix, -AppV, -Policy, -All Turn areas on
Disable-ZPAgentSync -Msix, -AppV, -Policy, -All Turn areas off
Get-ZPAgentSync — Per area Feature, Enabled and Source (GroupPolicy, Local, Default)

At least one switch is required; without one the cmdlet stops. When a group policy overrides the area, a warning says so.

Enable-ZPAgentSync -Msix -Policy
Get-ZPAgentSync

The same can be done through the settings MSIXSyncEnabled, AppVSyncEnabled and PolicyProcessingEnabled:

Set-ZPAgentConfiguration -MSIXSyncEnabled $true
Set-ZPAgentConfiguration -PolicyProcessingEnabled $true

5. Triggering a sync and checking status

Cmdlet Parameters Purpose
Sync-ZPAgentPublishingServer (alias Invoke-ZPAgentSync) -Method All\|Computer\|User, -Machine (alias -Global) Start a sync right away
Get-ZPAgentStatus — ModuleVersion, ServiceReachable, ServiceVersion, MachineSyncState, Servers

Without -Method the cmdlet follows the switches MachineSyncEnabled and UserSyncTaskEnabled, exactly like the scheduled sync. -Method Computer asks the service (no elevation needed), -Method User runs in the calling user's context. For automation over WinRM always use -Method Computer: a network logon carries no delegable ticket, so the user pass would reach the portal as an anonymous logon.

Sync-ZPAgentPublishingServer -Method Computer
Get-ZPAgentStatus

6. Looking at packages

Cmdlet Parameters Purpose
Get-ZPAgentPackage -Machine, -User Agent-managed packages per scope, with FamilyName, Version, SourceServerUrl, PendingRemove, LastSeenUtc
Get-ZPAgentMountedPackage -Family <pattern> (pos. 0) App Attach packages: where the data really lives, whether the image is attached, and whether format and mount match (Consistent)
Get-ZPAgentPackage -Machine
Get-ZPAgentMountedPackage libre*

7. Maintenance

Cmdlet Parameters Purpose
Invoke-ZPAgentPendingRemoveSweep — Drain deferred removals now
Clear-ZPAgentLog -WhatIf, -Confirm Delete log files: %ProgramData% (needs admin rights) and the current user's %LocalAppData%. Today's file stays locked

8. First configuration without group policy

Set-ZPAgentConfiguration -MSIXSyncEnabled $true
Set-ZPAgentConfiguration -PolicyProcessingEnabled $true
Add-ZPAgentPublishingServer -Name 'ZeroPortal' -Url 'https://zeroportalserver:8888'

Get-ZPAgentPublishingServer
Sync-ZPAgentPublishingServer -Method Computer
Get-ZPAgentStatus

App-V stays off on purpose. Turn it on only when the Microsoft App-V client does not fetch the packages from the portal itself.