Windows Service
On Windows, the collector runs as a Scheduled Task triggered at system startup. This page provides two setup methods: importing an XML task definition, or creating the task via PowerShell.
Prerequisites
Section titled “Prerequisites”- Collector binary (
ms-teams-agent.exe) placed in a permanent directory (e.g.,C:\Program Files\Phenisys\) - A valid
config.yamlin the same directory - Administrator privileges on the Windows host
- The service account must have Log on as a batch job rights
Method 1: Import XML Task Definition
Section titled “Method 1: Import XML Task Definition”Save the following XML as MSTeamsObservabilityAgent.xml, update the paths and user, then import.
<?xml version="1.0" encoding="UTF-16"?><Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Author>YOURDOMAIN\youruser</Author> <URI>\MSTeamsObservabilityAgent</URI> </RegistrationInfo> <Triggers> <BootTrigger> <Enabled>true</Enabled> </BootTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>YOURDOMAIN\youruser</UserId> <LogonType>Password</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT0S</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>"C:\Program Files\Phenisys\ms-teams-agent.exe"</Command> <Arguments>run --config "C:\Program Files\Phenisys\config.yaml"</Arguments> <WorkingDirectory>C:\Program Files\Phenisys</WorkingDirectory> </Exec> </Actions></Task>Import the task
Section titled “Import the task”- Update the XML:
- Replace
YOURDOMAIN\youruserwith your service account - Replace paths under
<Command>,<Arguments>, and<WorkingDirectory>with your installation path
- Replace
- Open Task Scheduler (
taskschd.msc) - Click Import Task… in the right sidebar
- Select your XML file
- Enter the password for the service account when prompted
Method 2: PowerShell
Section titled “Method 2: PowerShell”Run the following in an elevated PowerShell session:
$User = "YOURDOMAIN\youruser"$Credential = Get-Credential -UserName $User -Message "Enter your password"$PlainPassword = $Credential.GetNetworkCredential().Password
$Action = New-ScheduledTaskAction ` -Execute "C:\Program Files\Phenisys\ms-teams-agent.exe" ` -Argument 'run --config "C:\Program Files\Phenisys\config.yaml"'
$Trigger = New-ScheduledTaskTrigger -AtStartup
$Settings = New-ScheduledTaskSettingsSet ` -ExecutionTimeLimit (New-TimeSpan -Days 3) ` -StartWhenAvailable:$true ` -MultipleInstances "IgnoreNew" ` -RunOnlyIfIdle:$false
$Principal = New-ScheduledTaskPrincipal ` -UserId $User ` -LogonType Password ` -RunLevel Highest
$Task = New-ScheduledTask ` -Action $Action ` -Trigger $Trigger ` -Settings $Settings ` -Principal $Principal
Register-ScheduledTask ` -TaskName "MSTeamsObservabilityAgent" ` -InputObject $Task ` -User $Credential.UserName ` -Password $PlainPassword ` -ForceTask Settings Summary
Section titled “Task Settings Summary”| Setting | Value | Rationale |
|---|---|---|
| Trigger | At startup | Starts collection as soon as the host boots |
| Multiple instances | IgnoreNew | Prevents duplicate collector processes |
| Run level | HighestAvailable | Ensures network and filesystem access |
| Execution time limit | Unlimited (PT0S) / 3 days | Collector runs indefinitely; no hard timeout |
| Start when available | true (PowerShell) | Retries if the task misses its scheduled start |
| Stop on batteries | true | Preserves laptop battery when unplugged |
| Allow start on demand | true | Lets you manually trigger a run from Task Scheduler |
Verifying the Service
Section titled “Verifying the Service”- Open Task Scheduler and locate
MSTeamsObservabilityAgent - Right-click → Run to test immediately
- Check History tab for execution results
- Verify data appears in your backend after one collection cycle
Stopping the Collector
Section titled “Stopping the Collector”To stop the running collector:
Stop-ScheduledTask -TaskName "MSTeamsObservabilityAgent"To permanently disable:
Disable-ScheduledTask -TaskName "MSTeamsObservabilityAgent"To remove:
Unregister-ScheduledTask -TaskName "MSTeamsObservabilityAgent" -Confirm:$false