How to Detect and Restrict Claude Code with Intune

First find every Windows PC where Claude Code is installed, then use Intune to stop it from running where it is not approved. Kuntur does the finding; the restriction is done in Intune with Windows app control. This page covers Windows; for Macs see the Jamf version.

By Kuntur team · Published

Step 1: find where Claude Code is installed

Restrict only what you can see. Before writing a rule, find out which machines have Claude Code, for which users, and how it was installed: the install method decides what a rule has to match. Two free ways:

  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

It needs no account and no admin rights, writes an HTML report to the Desktop and uploads nothing.

Step 2: see what a rule has to match

Claude Code is usually installed per user, without admin rights: the native installer puts claude.exe in %USERPROFILE%\.local\bin, and the npm package @anthropic-ai/claude-code runs under node.exe. The script shows the path, whether the file is signed and by whom (a publisher rule survives updates; a path or hash rule may not), and whether an npm install exists.

Windows (PowerShell), read-only

# Read-only. Run as the user on a test PC: shows what an app control rule would match.
$exe = "$env:USERPROFILE\.local\bin\claude.exe"
if (Test-Path $exe) {
  $exe
  Get-AuthenticodeSignature $exe | Select-Object Status, @{ n = 'Signer'; e = { $_.SignerCertificate.Subject } }
  (Get-Item $exe).VersionInfo | Select-Object ProductName, CompanyName, FileVersion
}
# An npm install runs under node.exe, which a rule on claude.exe does not cover
Test-Path "$env:APPDATA\npm\node_modules\@anthropic-ai\claude-code"

Step 3: restrict Claude Code with Intune

Intune offers two ways to stop an app from running on Windows. Both are Windows features delivered by Intune, and both should start in audit mode.

For the native install, a deny rule on the signer the script prints is the most durable target. A path or hash rule also works, but it must cover every user's .local\bin folder and, for a hash rule, every new version. Test it on a pilot group in audit mode, then enforce.

For Claude Code there is a second, gentler control: managed settings. Instead of blocking the tool, you deploy a managed-settings.json that users cannot override, for example to switch off bypass-permissions mode with permissions.disableBypassPermissionsMode. Anthropic documents the file locations per OS; see Cursor and Claude Code in your company.

Roll out in audit mode first. App Control writes its events to Microsoft-Windows-CodeIntegrity/Operational and AppLocker to the Microsoft-Windows-AppLocker logs in Event Viewer, so you can see who would have been blocked before you enforce.

What the rule will not catch

Where Kuntur fits

Kuntur finds where Claude Code is installed, for every user profile, and lets you mark it approved or unauthorized with an audit trail. It does not block, restrict or uninstall anything: the restriction on this page is done by your MDM. Use the inventory before the rule (who will it affect?) and after it (are there installs the rule does not match, such as WSL or another install method?). If an auditor later asks how you controlled AI tools, the audit evidence pack exports those decisions with who made them and when. Still choosing a discovery tool? Shadow AI detection tools compared lists what proxy, browser, EDR and endpoint tools find, with a test you can run on one laptop.

Kuntur console: Claude Code detail with Approve and Mark unauthorized buttons, the computers and users that have it, its version and a high finding
What you get in Kuntur: every computer and user with Claude Code (including WSL), its version, related findings, and one click to approve it or mark it unauthorized. Example data.

Kuntur detects and reports; it does not block, restrict or uninstall anything. Free for up to 5 endpoints; Pro is US$3 per endpoint per month.

FAQ

Can Intune block Claude Code?
Intune can deliver Windows app control (App Control for Business or AppLocker) that stops Claude Code from running, ideally after an audit-mode trial. Intune itself does not detect Claude Code unless you add a detection script.
Does Kuntur block Claude Code?
No. Kuntur finds where Claude Code is installed and records whether you approved it. Blocking is done with Intune's app control features or your EDR.
Should I block Claude Code or restrict its settings?
If the concern is what it can do (skip approval prompts, run any shell command), managed settings are less disruptive than a block. If it is not approved at all, block it and keep the inventory to catch other install methods.

Sources

  1. Microsoft Learn: App Control for Business policy in Intune (built-in controls, audit mode, managed installer)
  2. Microsoft Learn: Deploy App Control policies using Intune
  3. Microsoft (archived blog): Blocking apps with Intune and the AppLocker CSP

More guides and tools: