Detect AI Tools on Windows with a Workspace ONE UEM Sensor

Workspace ONE UEM sensors run a PowerShell script on a schedule and store the value it returns for each device. This free sensor looks in every profile for Claude Code, Codex CLI, Cursor, Ollama, AI editor extensions and MCP configs, and returns one line you can report on.

By Kuntur team · Published

Why a sensor and not a script

Most AI coding tools install into the user's profile without admin rights, so they rarely show up as managed or even as installed apps. Claude Code's native installer drops a binary in %USERPROFILE%\.local\bin, Codex CLI and Gemini CLI arrive through npm, and Cursor installs per user.

Workspace ONE UEM has two places to run PowerShell. Scripts report a status per device: Executed when the exit code is 0 and Failed otherwise, which tells you nothing about what was found. Sensors store the value the script writes, as a string, number, boolean or date, and show it per device and in Omnissa Intelligence reports. For an inventory you want the value, so this guide uses a sensor.

What the sensor checks

The paths come from the same detection catalog the Kuntur agent and the Intune script use. For every profile under C:\Users (skipping Public, Default and system profiles) it checks:

ToolWhere it looks (per profile)
Claude Code.local\bin\claude.exe, .claude, npm @anthropic-ai/claude-code
Codex CLI.codex, npm @openai/codex
Gemini CLI.gemini, AppData\Roaming\npm\gemini.cmd, npm @google/gemini-cli
CursorAppData\Local\Programs\cursor, .cursor, plus C:\Program Files\cursor
WindsurfAppData\Local\Programs\Windsurf, .windsurf, .codeium\windsurf
Claude DesktopAppData\Local\AnthropicClaude, AppData\Local\Programs\Claude, Store package Claude_*, AppData\Roaming\Claude
ChatGPT DesktopStore package OpenAI.ChatGPT-Desktop_*, AppData\Local\Programs\ChatGPT
OllamaAppData\Local\Programs\Ollama, .ollama; counts model manifests
LM StudioAppData\Local\Programs\LM Studio, .lmstudio
AI extensionsVS Code extension folders for GitHub Copilot, Claude Code, Continue, Cline, Roo Code, Kilo Code, Codeium, ChatGPT, Gemini Code Assist, Amazon Q and Tabnine
MCP configsclaude_desktop_config.json, .claude.json, .cursor\mcp.json, Windsurf mcp_config.json, .gemini\settings.json, .lmstudio\mcp.json, VS Code mcp.json; counts server entries

It never prints file contents. For MCP configs it counts the entries under mcpServers (or servers for VS Code) without reading their commands, URLs or environment variables, which is where tokens tend to live.

Requirements

The sensor script

Download kuntur-ai-inventory-workspace-one.ps1 and read it before you upload it. It is read-only, makes no network calls and works on Windows PowerShell 5.1. Check the file against this SHA-256:

17ba561df122bba24f00243dd69b1974c863d62fd049be538e12018f52d3a4f6
Get-FileHash .\kuntur-ai-inventory-workspace-one.ps1 -Algorithm SHA256

The full script:

<#
  Kuntur AI inventory - Workspace ONE UEM sensor
  https://kuntur.io/guides/workspace-one-detect-ai-tools

  What it does
    Looks in every user profile on the device for AI coding tools, AI desktop
    apps, local model runners, AI editor extensions and MCP server configs.
    Read-only. No network. Never prints file contents or secrets: only tool
    names, counts and the user names that have something installed.
    Same detection catalog as the Kuntur Intune and NinjaOne scripts.

  Output and exit code (Workspace ONE UEM sensors)
    - A sensor reads only the FIRST value the script writes, so this prints
      exactly ONE line with Write-Output (never Write-Host).
      Response data type: String.
    - Always exits 0. In the Scripts resource, a non-zero exit code only
      shows as "Failed", which says nothing about what was found.

  Runs on Windows PowerShell 5.1. Use the system execution context so it can
  read every profile under C:\Users; in the user context it only sees what
  the signed-in user can read.
  Kuntur, November 2026. MIT licence.
#>
param(
  # Folder that holds the user profiles.
  [string]$ProfileRoot = $(if ($env:SystemDrive) { Join-Path $env:SystemDrive 'Users' } else { 'C:\Users' }),
  # Where machine-wide installs live. Empty skips the machine-wide check.
  [string]$ProgramFilesRoot = $env:ProgramFiles
)

$ErrorActionPreference = 'SilentlyContinue'
Set-StrictMode -Version 2.0

$MaxOutput = 1000   # Keep the sensor value short so it stays readable in reports.

function Join-Parts([string]$Base, [string[]]$Parts) {
  $p = $Base
  foreach ($part in $Parts) { $p = Join-Path $p $part }
  return $p
}

function Test-AnyPath([string]$Base, [object[]]$Candidates) {
  foreach ($c in $Candidates) {
    $full = Join-Parts $Base ([string[]]$c)
    if (Test-Path -Path $full) { return $true }
  }
  return $false
}

function Count-McpServers([string]$File, [string]$Key) {
  # Counts server entries under a JSON key. Reads names only, never values.
  try {
    $raw = Get-Content -LiteralPath $File -Raw -ErrorAction Stop
    $json = $raw | ConvertFrom-Json -ErrorAction Stop
  } catch { return 0 }
  $n = 0
  $node = $json.PSObject.Properties[$Key]
  if ($node -and $node.Value) { $n += @($node.Value.PSObject.Properties).Count }
  $projects = $json.PSObject.Properties['projects']   # ~/.claude.json keeps per-project servers
  if ($projects -and $projects.Value) {
    foreach ($proj in $projects.Value.PSObject.Properties) {
      $inner = $proj.Value.PSObject.Properties[$Key]
      if ($inner -and $inner.Value) { $n += @($inner.Value.PSObject.Properties).Count }
    }
  }
  return $n
}

# Tool definitions: each candidate is a list of path segments under the profile.
$Tools = [ordered]@{
  'Claude Code'    = @( @('.local','bin','claude.exe'), @('.claude'), @('AppData','Roaming','npm','node_modules','@anthropic-ai','claude-code') )
  'Codex CLI'      = @( @('.codex'), @('AppData','Roaming','npm','node_modules','@openai','codex') )
  'Gemini CLI'     = @( @('.gemini'), @('AppData','Roaming','npm','gemini.cmd'), @('AppData','Roaming','npm','node_modules','@google','gemini-cli') )
  'Cursor'         = @( @('AppData','Local','Programs','cursor'), @('.cursor') )
  'Windsurf'       = @( @('AppData','Local','Programs','Windsurf'), @('.windsurf'), @('.codeium','windsurf') )
  'Claude Desktop' = @( @('AppData','Local','AnthropicClaude'), @('AppData','Local','Programs','Claude'), @('AppData','Local','Packages','Claude_*'), @('AppData','Local','Packages','AnthropicPBC.Claude*'), @('AppData','Roaming','Claude') )
  'ChatGPT Desktop'= @( @('AppData','Local','Packages','OpenAI.ChatGPT-Desktop_*'), @('AppData','Local','Programs','ChatGPT') )
  'Ollama'         = @( @('AppData','Local','Programs','Ollama'), @('.ollama') )
  'LM Studio'      = @( @('AppData','Local','Programs','LM Studio'), @('AppData','Local','Programs','lm-studio'), @('.lmstudio') )
}

$ExtensionPatterns = @(
  'github.copilot-*', 'github.copilot-chat-*', 'anthropic.claude-code-*', 'continue.continue-*',
  'saoudrizwan.claude-dev-*', 'rooveterinaryinc.roo-cline-*', 'kilocode.kilo-code-*', 'codeium.codeium-*',
  'openai.chatgpt-*', 'google.geminicodeassist-*', 'amazonwebservices.amazon-q-vscode-*', 'tabnine.tabnine-vscode-*'
)

# MCP config files and the JSON key that lists servers.
$McpConfigs = @(
  @{ Parts = @('AppData','Roaming','Claude','claude_desktop_config.json'); Key = 'mcpServers' },
  @{ Parts = @('.claude.json');                                           Key = 'mcpServers' },
  @{ Parts = @('.cursor','mcp.json');                                     Key = 'mcpServers' },
  @{ Parts = @('.codeium','windsurf','mcp_config.json');                  Key = 'mcpServers' },
  @{ Parts = @('.gemini','settings.json');                                Key = 'mcpServers' },
  @{ Parts = @('.lmstudio','mcp.json');                                   Key = 'mcpServers' },
  @{ Parts = @('AppData','Roaming','Code','User','mcp.json');             Key = 'servers' }
)

$SkipProfiles = @('Public','Default','Default User','All Users','WDAGUtilityAccount','defaultuser0','DefaultAppPool')

$toolUsers   = [ordered]@{}   # tool name -> list of users
$ollamaModels = 0
$extCount = 0; $extUsers = @()
$mcpFiles = 0; $mcpServers = 0; $mcpUsers = @()
$usersWithAI = @()

$profiles = @(Get-ChildItem -LiteralPath $ProfileRoot -Directory -Force | Where-Object {
  ($SkipProfiles -notcontains $_.Name) -and ($_.Name -notlike '.*') -and ($_.Name -notlike 'defaultuser*')
})

foreach ($prof in $profiles) {
  $home_ = $prof.FullName
  $user = $prof.Name
  $hit = $false

  foreach ($name in $Tools.Keys) {
    if (Test-AnyPath $home_ $Tools[$name]) {
      if (-not $toolUsers.Contains($name)) { $toolUsers[$name] = @() }
      $toolUsers[$name] += $user
      $hit = $true
    }
  }

  $manifests = Join-Parts $home_ @('.ollama','models','manifests')
  if (Test-Path -LiteralPath $manifests) {
    $ollamaModels += @(Get-ChildItem -LiteralPath $manifests -Recurse -File -Force).Count
  }

  $extDir = Join-Parts $home_ @('.vscode','extensions')
  if (Test-Path -LiteralPath $extDir) {
    $extFound = @(Get-ChildItem -LiteralPath $extDir -Directory -Force | Where-Object {
      $n = $_.Name.ToLowerInvariant(); $m = $false
      foreach ($pat in $ExtensionPatterns) { if ($n -like $pat) { $m = $true; break } }
      $m
    })
    if ($extFound.Count -gt 0) { $extCount += $extFound.Count; $extUsers += $user; $hit = $true }
  }

  $userMcp = $false
  foreach ($cfg in $McpConfigs) {
    $f = Join-Parts $home_ ([string[]]$cfg.Parts)
    if (Test-Path -LiteralPath $f -PathType Leaf) {
      $servers = Count-McpServers $f $cfg.Key
      if ($servers -gt 0) { $mcpFiles++; $mcpServers += $servers; $userMcp = $true }
    }
  }
  if ($userMcp) { $mcpUsers += $user; $hit = $true }

  if ($hit) { $usersWithAI += $user }
}

# Machine-wide installs (all users).
$machineWide = @()
if ($ProgramFilesRoot) {
  foreach ($p in @(
      @{ Name = 'Cursor'; Path = (Join-Path $ProgramFilesRoot 'cursor') },
      @{ Name = 'Ollama'; Path = (Join-Path $ProgramFilesRoot 'Ollama') })) {
    if (Test-Path -LiteralPath $p.Path) { $machineWide += $p.Name }
  }
}

$parts = @()
foreach ($name in $toolUsers.Keys) {
  $n = @($toolUsers[$name] | Select-Object -Unique).Count
  if ($name -eq 'Ollama' -and $ollamaModels -gt 0) { $parts += ('{0}({1}; {2} models)' -f $name, $n, $ollamaModels) }
  else { $parts += ('{0}({1})' -f $name, $n) }
}
foreach ($m in ($machineWide | Select-Object -Unique)) {
  if (-not $toolUsers.Contains($m)) { $parts += ('{0}(machine)' -f $m) }
}
if ($extCount -gt 0) { $parts += ('AI extensions({0} in {1})' -f $extCount, @($extUsers | Select-Object -Unique).Count) }
if ($mcpFiles -gt 0) { $parts += ('MCP configs({0}; {1} servers)' -f $mcpFiles, $mcpServers) }

$found = $parts.Count -gt 0
if ($found) {
  $line = 'AI tools: ' + ($parts -join ', ')
  $userList = @($usersWithAI | Select-Object -Unique)
  if ($userList.Count -gt 0) { $line += ' | users: ' + ($userList -join ',') }
} else {
  $line = 'AI tools: none found in ' + $profiles.Count + ' profiles'
}
if ($line.Length -gt $MaxOutput) { $line = $line.Substring(0, $MaxOutput - 3) + '...' }

Write-Output $line
exit 0

A sensor reads only the first value the script writes, and only from the output stream, so the script prints exactly one line with Write-Output and never uses Write-Host. It always exits 0.

Create and assign the sensor

  1. In the Workspace ONE UEM console, go to Resources › Sensors › Add and choose Windows.
  2. On General, enter a name such as kuntur_ai_inventory. Sensor names start with a lowercase letter and use only letters, digits and underscores, with no spaces.
  3. On Details, set Language to PowerShell, Execution Context to the system context (not the user), Execution Architecture so it runs as 64-bit on 64-bit devices, and Response Data Type to String. Upload kuntur-ai-inventory-workspace-one.ps1.
  4. Select Save & Assign, add an assignment, and pick the smart group to target.
  5. On Deployment, choose the triggers. A periodic schedule is enough for an inventory; adding a login trigger catches laptops that are rarely on during the schedule.

Running in the user context would only show what the signed-in user can read, which misses every other profile on shared machines.

Read the results

For one device, open its details page and the Sensors tab: the value is the one-line summary, for example AI tools: Claude Code(1), Cursor(1), MCP configs(1; 3 servers) | users: alice, or AI tools: none found in 2 profiles.

For the fleet, use Omnissa Intelligence: sensor values appear under the Workspace ONE UEM category as Device Sensors, where you can build a report or dashboard filtered to values that do not contain none found. Values arrive when each device next runs the trigger, so give it a day before treating a gap as clean.

What it does not see

Do it continuously across the fleet

To check one machine by hand first, the free Kuntur scanner lists the same tools on that computer and writes an HTML report:

  1. Download scan.ps1.
  2. Read it. It's plain text; here's what it does.
  3. Check its SHA-256 against the published hash: Get-FileHash .\scan.ps1 -Algorithm SHA256
  4. Run it: powershell -ExecutionPolicy Bypass -File .\scan.ps1

Windows shortcut, if you trust the source (PowerShell)

irm https://app.kuntur.io/scan.ps1 | iex

macOS and Linux (Terminal)

curl -fsSL https://app.kuntur.io/scan.sh | sh

The sensor gives you one line per device. The Kuntur agent is an MSI that installs silently with msiexec /qn, so you can deliver it as a Workspace ONE application to the same smart groups. The Kuntur agent reports a full inventory from every device: the tool, version, which user, whether it runs on the host, in WSL, in a container or a VM, MCP servers with their risky settings, and local models. It catches tools that are not on any fixed list through network and runtime signals, and you mark each one approved or unauthorized for the whole organization.

Free for up to 5 endpoints. Pro is US$3 per endpoint per month (or US$30 per endpoint per year) for 10 to 30 endpoints. The trial needs no credit card. Kuntur detects and reports; it does not block or uninstall anything.

The same inventory in other tools

The detection catalog is the same in every version; only the way each tool runs the script and shows its output changes.

More guides and tools:

FAQ

Should I use a sensor or a script in Workspace ONE?
A sensor. Scripts only report Executed or Failed based on the exit code, while a sensor stores the value the script returns for each device, which is the inventory you want.
Which execution context should the sensor use?
The system context. It can read every profile under C:\Users. In the user context it only sees what the signed-in user can read.
Does the sensor collect secrets or file contents?
No. It checks whether paths exist, counts model manifests and extension folders, and counts the server entries in MCP config files without reading their values. The output only contains tool names, counts and the user names of profiles where something was found.
Does it work on macOS devices in Workspace ONE?
No, this sensor is PowerShell for Windows. For Macs, the logic in the Jamf extension attribute script is a starting point for a macOS sensor.

Sources

  1. Omnissa docs: Sensors for Windows desktop devices
  2. Omnissa docs: Scripts for Windows desktop devices
  3. Claude Code docs: Advanced setup (install methods and locations)