spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / examples / mdm / windows / Set-ClaudeCodePolicy.ps1
28 lines · 885 BRaw
1<#
2Deploys Claude Code managed settings as a JSON file.
3
4Intune: Devices > Scripts and remediations > Platform scripts > Add (Windows 10 and later).
5 Run this script using the logged on credentials: No
6 Run script in 64 bit PowerShell Host: Yes
7
8Claude Code reads C:\Program Files\ClaudeCode\managed-settings.json at startup
9and treats it as a managed policy source. Edit the JSON below to change the
10deployed settings; see https://code.claude.com/docs/en/settings for available keys.
11#>
12
13$ErrorActionPreference = 'Stop'
14
15$dir = Join-Path $env:ProgramFiles 'ClaudeCode'
16New-Item -ItemType Directory -Path $dir -Force | Out-Null
17
18$json = @'
19{
20 "permissions": {
21 "disableBypassPermissionsMode": "disable"
22 }
23}
24'@
25
26$path = Join-Path $dir 'managed-settings.json'
27[System.IO.File]::WriteAllText($path, $json, (New-Object System.Text.UTF8Encoding($false)))
28Write-Output "Wrote $path"