# Deploy Claude Desktop with Microsoft Intune (Win32 + auto-update)

Scripts and instructions for deploying the Claude Desktop **direct-download
MSIX** through Microsoft Intune as a **Win32 (`.intunewin`) app**, so that
Claude's built-in auto-updater keeps devices current **and** Intune keeps
reporting the app as installed.

> **Why not the native MSIX line-of-business (LOB) app type?**
> The LOB app type detects the app by the *exact* package version uploaded to
> Intune. Claude updates itself in place (within the MSIX framework — the
> package identity `Claude_pzs8sxrjxfjjc` never changes, only the version), so
> after the first auto-update the device no longer has the exact version Intune
> deployed and the deployment flips to **"installation failed"
> (0x87D1041C)** even though the app is installed and working. The Win32 path
> with the version-aware detection script in this directory avoids that.
>
> If you prefer IT to own update cadence instead, deploy as a LOB app and
> disable auto-updates via the `disableAutoUpdates` policy — see the
> [enterprise configuration article](https://code.saschaberens.de/_h/support.claude.com/en/articles/12622667-enterprise-configuration).
>
> Deploying only the `disableAutoUpdates` or `autoUpdaterEnforcementHours`
> policies does **not** mark the install as organization-managed — users can
> still configure an inference provider via the in-app Setup panel. Deploying
> any other key the app recognizes under `HKLM\SOFTWARE\Policies\Claude`
> switches the install to fully managed and the panel becomes read-only.
>
> The app enumerates the `Policies` key on Windows: a key containing **no**
> value names the managed tier can honor (misspelled, newer-version, or a key
> another channel delivers) locks the Setup panel — the install reads as
> managed-but-unusable until those values are corrected or removed — while
> such names alongside recognized keys surface as config-health warnings
> without changing the management state. Verify the panel state on a test
> device after deploying a profile that should manage it.

## Contents

| File | Used as |
| --- | --- |
| `Install-Claude.ps1` | Intune **install command** (packaged inside the `.intunewin`). Installs a bundled `.msix` if one is packaged next to it; otherwise downloads the current release from Anthropic's official endpoint, verifies its signature, and installs that. |
| `Uninstall-Claude.ps1` | Intune **uninstall command** (packaged inside the `.intunewin`). Removes the app. It deletes no user data itself (see [step 5](#5-uninstalling-and-the-data-that-stays)). |
| `Remove-ClaudeUserData.ps1` | Intune **platform script**, uploaded as it is and run as the user (*not* part of the `.intunewin`, but for the one case in step 5). Deletes the data an uninstall leaves in that user's profile. |
| `Detect-Claude.ps1` | Intune **custom detection script** (uploaded separately in the app's detection rules — *not* part of the `.intunewin`) |

All scripts target Windows PowerShell 5.1 (what the Intune Management Extension
uses), run correctly from the 32-bit IME host (they re-launch themselves in
64-bit PowerShell), match the package by its full family name
(`Claude_pzs8sxrjxfjjc`, which pins Anthropic's signing publisher), and write a
transcript log to `%TEMP%` (`C:\Windows\Temp` when running as SYSTEM).

Official copies of these files are published with each Windows release at
fixed URLs, alongside a `Claude-Intune-SHA256SUMS.txt` you can verify
downloads against:

```
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Detect-Claude.ps1
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Install-Claude.ps1
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Remove-ClaudeUserData.ps1
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Uninstall-Claude.ps1
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Claude-Intune-README.md
https://code.saschaberens.de/_h/downloads.claude.ai/releases/enterprise/intune/Claude-Intune-SHA256SUMS.txt
```

## Prerequisites

- **Sideloading** enabled on target devices: `ApplicationManagement/AllowAllTrustedApps = 1`
  (Intune Settings Catalog or custom CSP). Developer Mode is *not* required.
- **Cowork only:** local Cowork sessions run in a virtual machine that needs the
  `VirtualMachinePlatform` Windows feature, and enabling it requires a restart. To check, run
  `(Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform).State`
  in an elevated PowerShell. If it returns `Enabled`, the feature is on and needs no restart.
  Otherwise, follow the [Windows deployment article](https://code.saschaberens.de/_h/support.claude.com/en/articles/12622703-deploy-claude-desktop-for-windows)
  to enable the feature and schedule the restart.
- The [Microsoft Win32 Content Prep Tool](https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool)
  (`IntuneWinAppUtil.exe`).

## 1. Build the `.intunewin`

Two packaging options — both use the same scripts and the same Intune app
configuration; they differ only in whether the `.msix` is inside the package.

### Option A — scripts only (recommended)

Wrap just the two scripts. At install time, `Install-Claude.ps1` resolves the
current Claude release for the device's architecture from Anthropic's official
endpoint, downloads it, verifies it, installs it, and deletes the download.
Verification requires a chain-valid Authenticode signature **and** pins the
package identity to Claude's exact publisher (family suffix
`pzs8sxrjxfjjc`, derived from Anthropic's full signing-certificate subject) —
a package signed by any other publisher is rejected before it reaches the
deployment stack. A package is also rejected if its signer's certificate chain
includes a certificate authority on the script's `$DistrustedKeys` list, or
cannot be verified up to a trusted root certificate. To additionally pin the
exact signing certificate, pass `-ExpectedSignerThumbprint <SHA-1 thumbprint>`
in the install command; note that this pin must be updated whenever Anthropic
renews its signing certificate, while the default publisher pin needs no
maintenance. Devices that already have an equal-or-newer Claude skip the
download entirely.

```
ClaudeIntune\
  Install-Claude.ps1
  Uninstall-Claude.ps1
  Remove-ClaudeUserData.ps1  <- only if the uninstall command passes -RemoveUserData (step 5)

IntuneWinAppUtil.exe -c .\ClaudeIntune -s Install-Claude.ps1 -o .\out
```

- New enrollments always install the **latest** release — the package never
  goes stale, so there is nothing to re-wrap or refresh, ever.
- Requires devices to reach `claude.ai` and `downloads.claude.ai` at install
  time (the same endpoints the app itself uses to run and update).

### Option B — bundle the MSIX

Wrap a specific `.msix` into the package. The install script uses the bundled
copy and never goes to the network. Choose this when install-time egress is
restricted, or when you want to pin exactly which build seeds new devices.

Download the `.msix` for your architecture:

- x64: `https://code.saschaberens.de/api/desktop/win32/x64/msix/latest/redirect`
- arm64: `https://code.saschaberens.de/api/desktop/win32/arm64/msix/latest/redirect`

```
ClaudeIntune\
  Claude-x64.msix          <- the downloaded MSIX (any Claude*.msix name works)
  Install-Claude.ps1
  Uninstall-Claude.ps1
  Remove-ClaudeUserData.ps1  <- only if the uninstall command passes -RemoveUserData (step 5)

IntuneWinAppUtil.exe -c .\ClaudeIntune -s Install-Claude.ps1 -o .\out
```

With this option, refresh the bundled `.msix` a few times a year (rebuild the
`.intunewin` with a current download and update the app content in Intune) so
newly enrolled devices don't start from an old build and immediately download
a large update. Devices that are already current are unaffected by a refresh.

## 2. Optional: configure `Detect-Claude.ps1`

As shipped (`$MinimumVersion = "0.0.0.0"`), the detection script reports
Claude as installed when **any version** is provisioned or registered for a
person's account — self-updates never break detection and no edit is needed.
Optionally, set a baseline:

```powershell
$MinimumVersion = "1.2.345.0"
```

Detection then requires **version ≥ `$MinimumVersion`**, so devices below the
baseline (for example, one whose updater never ran because the app was never
launched) are remediated by the install command instead of being reported as
already installed. With Option B, set this to the bundled MSIX's version and
bump it on each refresh.

## 3. Create the app in Intune

Apps → Windows → **Add** → App type **Windows app (Win32)**, then:

| Setting | Value |
| --- | --- |
| App package file | the `.intunewin` from step 1 |
| Install command | `powershell.exe -NoProfile -ExecutionPolicy Bypass -File Install-Claude.ps1` |
| Uninstall command | `powershell.exe -NoProfile -ExecutionPolicy Bypass -File Uninstall-Claude.ps1` |
| Install behavior | **System** (recommended — provisions Claude for every user on the device). Only choose **User** if the targeted users are local administrators: the Claude package registers a Windows service for Cowork, so per-user registration fails for standard users. |
| Device restart behavior | No specific action |
| Return codes | defaults (0 = success) |
| Requirement rules | OS architecture: x64 and arm64 with Option A (the script downloads the right one per device), or the single architecture you bundled with Option B; minimum OS Windows 10 2004 (build 19041) — the package's own minimum supported version |
| Detection rules | Rules format **Use a custom detection script** → upload `Detect-Claude.ps1`. "Run script as 32-bit process": **No**. "Enforce script signature check": **No** (or sign the script with your own code-signing cert and select Yes) |

Assign to your device or user groups as usual.

Notes on install behavior:

- **System**: the package is *provisioned* machine-wide. Users who are already
  signed in get Claude registered at their **next sign-in**; new users get it at
  first sign-in. This is the equivalent of the previous LOB/device-group setup.
- **User**: Claude installs immediately for the targeted user, no sign-out
  needed — but registering the package (which includes Cowork's Windows
  service) requires the signed-in user to be a local administrator, so this
  mode is not suitable for standard-user fleets.

## 4. Updates

Leave Claude's auto-updater enabled (do **not** set `disableAutoUpdates` on
this path). Devices stay current on their own; the detection script keeps the
Intune status green. The `autoUpdaterEnforcementHours` policy (default 72h)
controls how long a downloaded update can be deferred before Claude restarts
to apply it.

With Option A there is no package maintenance at all. With Option B, refresh
the bundled `.msix` occasionally as described in step 1.

## 5. Uninstalling, and the data that stays

An uninstall for all users (as SYSTEM, or with `-Scope Machine` from another
account) does not close a running Claude. Have people quit Claude first: in
Claude, ☰ → File → **Exit**. Otherwise a later install can fail: see
[Troubleshooting](#troubleshooting). An uninstall as the user, in their own
session, closes Claude.

`Uninstall-Claude.ps1` removes the app. With it, Windows deletes only what is
inside the package's own folder,
`%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc`. Claude also keeps per-user data
**outside** that folder. That data stays on the device after an uninstall, and
a later reinstall starts from it, sign-in included. Reset under Settings → Apps
→ Installed apps → Claude → Advanced options, and `Reset-AppxPackage`, leave it
too: Windows empties only the package's own folder. So neither a reinstall nor a
Windows Reset is a clean slate.

Below Windows 11 (build 22000) Windows ignores the package's excluded folders,
so some or all of this can be inside the package's own folder and go with it.
`Remove-ClaudeUserData.ps1` deletes what is left, on any Windows.

| Folder, per user | What it holds |
| --- | --- |
| `%LOCALAPPDATA%\Claude-Data` | Settings, sign-in, Cowork tasks and the Cowork VM image. Claude moves a person's data here, into a folder named `claude_pzs8sxrjxfjjc`, from the package's own folder. Until it has, the data goes with the package. With the `relocateUncUserData` policy the data is in `Claude-Data` itself. |
| `%LOCALAPPDATA%\Claude-3p` | The same data for deployments on third-party inference, logs included. Every Claude build for Windows uses this one folder. |
| `%LOCALAPPDATA%\Claude\logs` | Logs. Every Claude build for Windows uses this one folder. |

### Removing that data

`Remove-ClaudeUserData.ps1` deletes those folders, and whatever Windows left of
the package's own folder. It only deletes data: it never uninstalls anything. It
takes no parameters. What it deletes cannot be brought back: Cowork tasks exist
only on the device.

**It deletes only the data of the account it runs as, and refuses to run as
SYSTEM.** These folders are writable by their user. If SYSTEM deleted in them,
or only looked, a user could replace one with a link and have SYSTEM delete
another folder or sign in to a network share. Run as the user, the script can
reach nothing that the user could not reach anyway.

| When it runs | What it does |
| --- | --- |
| As SYSTEM | Deletes nothing and looks in no profile. Exit code 1. |
| Claude is still installed for that user, or Windows cannot say whether it is | Deletes nothing. Exit code 1. |
| Another Claude build is installed for that user: the Microsoft Store build, or the earlier `.exe` install (`%LOCALAPPDATA%\AnthropicClaude\Update.exe`) | Deletes only what is this package's alone: `Claude-Data\claude_pzs8sxrjxfjjc`, `Claude-Data\~copying.claude_pzs8sxrjxfjjc` (a copy of it that Claude began and did not finish; most devices have none) and what is left of the package's own folder. Leaves `Claude-3p`, `Claude\logs` and the rest of `Claude-Data`, which that build uses, and lists them in the log. That is not a failure. |
| Otherwise | Deletes all of it. If the Store build left its own folder, `Claude-Data\anthropicpbc.claude_fnn82j28hfe8t`, that folder stays and everything else in `Claude-Data` goes. |

| Exit code of `Remove-ClaudeUserData.ps1` | Meaning |
| --- | --- |
| 0 | Done. Nothing is left but what the log says was left on purpose. An empty folder does not count. |
| 1 | Nothing was deleted: it ran as SYSTEM, Claude is still installed for that user, or a check failed before the first delete. |
| 2 | Some data is still there and the log lists it: a program holds it open, it is behind a link, or an error cut the run short. |

**With Intune and install behavior System** (the setup above), the uninstall
command runs as SYSTEM, so leave it as it is and delete the data with a second
assignment that runs as the user:

1. Devices → Scripts and remediations → **Platform scripts** → Add → Windows 10
   and later, and upload `Remove-ClaudeUserData.ps1` as it is.
2. "Run this script using the logged on credentials": **Yes**. "Enforce script
   signature check": **No** (or sign the script with your own code-signing cert
   and select Yes). "Run script in 64 bit PowerShell Host": **Yes**.
3. Assign it after the uninstall has gone out.
4. **Remove the assignment before you deploy Claude to that group again.**
   Intune runs a script assigned to a device for every new user who signs in,
   and runs scripts before it installs apps.

What Intune does with it:

- While Claude is still installed for a user the script does nothing, so a
  person who has Claude installed loses nothing if the script reaches the wrong
  group. A person who has uninstalled it loses the data a reinstall would have
  picked up. On a device it reaches before the uninstall does, it fails with
  exit code 1 and Intune tries it again.
- Intune retries a failed script three times, at its next check-ins, and no
  more.
- On multi-session editions of Windows with user check-in disabled, Intune does
  not run it.

**With Intune and install behavior User**, the uninstall command already runs as
the user and can do both. Package `Remove-ClaudeUserData.ps1` beside
`Uninstall-Claude.ps1` in the `.intunewin` and add `-RemoveUserData` to the
uninstall command. The switch is off by default. Once Windows confirms that the
package is gone it runs the other script from the same folder.

| Exit code of `Uninstall-Claude.ps1` | Meaning |
| --- | --- |
| 0 | Done. With the switch: as exit code 0 above. Without it, as SYSTEM with `-Scope User`, it can also mean nothing was removed, because a person has Claude or a copy is provisioned. The log says so. |
| 1 | The package could not be removed, or Windows could not confirm that it is gone. If Windows still lists it after an uninstall for all users, the log lists what is left. No data was deleted. |
| 2 | Only with the switch. The package is gone, but the delete you asked for was not made (the script ran as SYSTEM or with `-Scope Machine`, `Remove-ClaudeUserData.ps1` was not beside it, or it stopped before its first delete), or it left something, as exit code 2 above. |

**Without Intune**, run the script in each person's own session after the
uninstall:

```
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Remove-ClaudeUserData.ps1
```

What to expect:

- **A program holds a file open.** `Remove-ClaudeUserData.ps1` does not delete
  that file. It lists the file's folder and exits with code 2. Run the script
  again later.
- **A shared or returned device.** Until this data is deleted, whoever next
  installs Claude in the same Windows account starts from it, with the earlier
  person's sign-in. Run the script in that account, or remove the account.
- **People who are not signed in.** Nothing of theirs is deleted. A script
  assigned to run as the user reaches them when they next sign in.
- **Roaming profiles.** `%LOCALAPPDATA%` does not roam, so the data is on each
  device the person used Claude on, and is deleted device by device.
- **FSLogix and other profile containers.** The data is inside the container,
  which is attached only while the person is signed in. A run as the user
  reaches it.
- **Links.** A link at one of these folders, or below one, is removed as a link,
  and what it points to stays whole. For a link at one of them, or at either of
  this package's two folders in `Claude-Data`, the log says where it pointed and
  the exit code is 2: the data is still on the device. Where the folder above
  (`Packages`, `Claude-Data` or `Claude`) is itself a link, what is under it is
  left and listed, and the exit code is 2.
- **Never touched:** policy values under `HKLM\SOFTWARE\Policies\Claude`,
  `C:\ProgramData\Claude\Logs` (the Cowork service's logs), `%APPDATA%\Claude`
  (data of the earlier `.exe` installer), `%USERPROFILE%\.claude` and
  `.claude.json` (shared with Claude Code in a terminal), `%USERPROFILE%\Claude`
  or, on older installs, `Documents\Claude` (the files of people's Cowork
  tasks), the browser extension's helper keys under `HKCU`
  (`NativeMessagingHosts\com.anthropic.claude_browser_extension`), the Microsoft
  Store build's own data, the shared folders while another Claude build is
  installed, and files people saved outside these folders.

People can also do this themselves before an uninstall, in each mode they have
used: in Claude, Help → Troubleshooting → **Reset App Data…** → **Reset and
quit**. That clears only the mode Claude is in; the script removes both modes'
folders at once.

## Migrating from a native MSIX / LOB deployment

If you previously deployed Claude as a LOB app and the deployment now shows
"installation failed" after auto-updates:

1. Create the Win32 app above and assign it to the same group.
2. `Install-Claude.ps1` detects the existing (newer) install and exits
   successfully without touching it; the detection script then reports it
   installed. No reinstall happens on devices that already have Claude. The
   exception is a copy registered only for the SYSTEM account, which no one
   can start. When the script runs as SYSTEM and no copy is provisioned, it
   removes that copy and installs Claude. See
   [Troubleshooting](#troubleshooting).
3. Remove the assignment from (or delete) the old LOB app entry. Don't select
   "Uninstall" for the old assignment — just remove it.

## Troubleshooting

| Symptom | Explanation |
| --- | --- |
| LOB deployment shows **0x87D1041C — "application was not detected after installation completed successfully"** after Claude updates itself | Expected with the LOB app type + auto-update (exact-version detection). Use this Win32 path, or disable auto-updates and own the cadence in Intune. |
| **0x80073D06 — "a newer version of this package is already installed"** during install | The device is already ahead of the wrapped baseline (auto-updater ran). `Install-Claude.ps1` treats this as success. |
| `Install-Claude.ps1` fails with **"ERROR: Access is denied."** (exit code 1) after an uninstall | Most likely, Claude is still running: an uninstall as SYSTEM, or with `-Scope Machine` from another account, does not close it, even when the uninstall reports success. Have people quit Claude (☰ → File → **Exit**), then run the install again. |
| Detection works when run manually but fails from Intune | Intune runs detection as SYSTEM; make sure you're using `Detect-Claude.ps1` from this directory (it checks `-AllUsers` and provisioned packages, and re-launches in 64-bit PowerShell). |
| Install logs | `Claude-Intune-Install-*.log` / `Claude-Intune-Uninstall-*.log` / `Claude-Intune-RemoveData-*.log` in `%TEMP%` (`C:\Windows\Temp` for system-context installs; the user's own `%TEMP%` for `Remove-ClaudeUserData.ps1`), plus the IME log `%ProgramData%\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log`. |
| Need to verify what's on a device | `Get-AppxPackage -Name Claude -AllUsers` (admin PowerShell) shows the installed version; the package family name is always `Claude_pzs8sxrjxfjjc`. The `PackageUserInformation` field of that output lists the accounts Claude is registered for. |
| `Get-AppxPackage -Name Claude -AllUsers` lists Claude for `S-1-5-18` (the SYSTEM account), often with status `Servicing`, and for no person's account | No one can start this copy. It is often an update that was waiting for Claude to close when someone uninstalled Claude. To clear it, run `Install-Claude.ps1` or `Uninstall-Claude.ps1` as SYSTEM (install behavior **System** in Intune); `Remove-AppxPackage -AllUsers` does not remove it. The install script leaves it if a copy is provisioned; `Uninstall-Claude.ps1` as SYSTEM removes both. If a run as SYSTEM does not clear it, send the log to Anthropic support. Until it is gone, `Detect-Claude.ps1` reports Claude as not installed unless a copy is provisioned. |
| `Uninstall-Claude.ps1` exits with code 1 and logs **"Still on this device: …"** or **"Still provisioned: …"** | Windows still lists Claude after the uninstall. Each "Still on this device" line names the package and the accounts it is registered for. If the only account is `S-1-5-18` and the script did not run as SYSTEM, run it as SYSTEM (install behavior **System** in Intune). In any other case, send the log to Anthropic support. |

## Package identity reference

| Field | Value |
| --- | --- |
| Package name | `Claude` |
| Package family name | `Claude_pzs8sxrjxfjjc` |
| Publisher display name | Anthropic, PBC |
| Version | increments every release; identity (name/publisher/family) never changes across updates |

The Microsoft Store build of Claude uses a different identity
(`AnthropicPBC.Claude`) and is not matched by these scripts.
`Remove-ClaudeUserData.ps1` only asks whether it is installed, to leave what it
shares.
