Skip to content

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.

  • Collector binary (ms-teams-agent.exe) placed in a permanent directory (e.g., C:\Program Files\Phenisys\)
  • A valid config.yaml in the same directory
  • Administrator privileges on the Windows host
  • The service account must have Log on as a batch job rights

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>
  1. Update the XML:
    • Replace YOURDOMAIN\youruser with your service account
    • Replace paths under <Command>, <Arguments>, and <WorkingDirectory> with your installation path
  2. Open Task Scheduler (taskschd.msc)
  3. Click Import Task… in the right sidebar
  4. Select your XML file
  5. Enter the password for the service account when prompted

Run the following in an elevated PowerShell session:

Terminal window
$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 `
-Force
SettingValueRationale
TriggerAt startupStarts collection as soon as the host boots
Multiple instancesIgnoreNewPrevents duplicate collector processes
Run levelHighestAvailableEnsures network and filesystem access
Execution time limitUnlimited (PT0S) / 3 daysCollector runs indefinitely; no hard timeout
Start when availabletrue (PowerShell)Retries if the task misses its scheduled start
Stop on batteriestruePreserves laptop battery when unplugged
Allow start on demandtrueLets you manually trigger a run from Task Scheduler
  1. Open Task Scheduler and locate MSTeamsObservabilityAgent
  2. Right-click → Run to test immediately
  3. Check History tab for execution results
  4. Verify data appears in your backend after one collection cycle

To stop the running collector:

Terminal window
Stop-ScheduledTask -TaskName "MSTeamsObservabilityAgent"

To permanently disable:

Terminal window
Disable-ScheduledTask -TaskName "MSTeamsObservabilityAgent"

To remove:

Terminal window
Unregister-ScheduledTask -TaskName "MSTeamsObservabilityAgent" -Confirm:$false