Technical Reference / Microsoft Intune
Microsoft Intune
Deploy the device agent with Microsoft Intune: deliver the identity file first, then create the agent app, add the installer for each platform, verify enrollment, and start the Windows tray UI at sign-in.
This guide walks an Intune rollout of the device agent from start to finish: deliver the identity file for managed enrollment, create the agent app, add the installer for each platform, verify enrollment, and start the Windows tray UI at sign-in. Shared concepts (the configuration schema, delivery channels, and coverage states) are on the MDM installations page.
Set up the identity file before the agent app. The daemon reads the identity file only when it starts, so an agent that installs first starts unenrolled and stays that way until it restarts.
Step 1: Set up the identity file
Section titled “Step 1: Set up the identity file”Every platform uses the same schema, but the update mode depends on the platform and update owner. Use automatic on macOS. On Windows, use notify for Intune-controlled updates or automatic for agent-controlled updates:
{ "v": 1, "email": "jane.doe@example.com", "org_token": "spk_org_…", "org_slug": "example-corp", "auto_update": "AUTO_UPDATE_MODE"}The file must be readable by the logged-in user, and the daemon only reads it at startup, so restart the daemon after any change.
Windows
Section titled “Windows”Package the script below as its own Win32 app. In Step 3 it is attached to the agent app as a dependency, so Intune installs it first on every device.
1. Set the org token, update owner, and configuration revision. Save the following as Deploy-SpeakeasyManagedJson.ps1, replace REPLACE_WITH_ORG_TOKEN with the organization token from Organization Settings → Secure → Device Agent, and replace AUTO_UPDATE_MODE with notify for Intune-controlled updates or automatic for agent-controlled updates. Set CONFIG_REVISION to a unique value and change it whenever the token or configuration changes. Leave {{mail}} in place; the script substitutes it at install time. Use the form below to fill in the revision, organization details, and update mode, then copy the script. Replace REPLACE_WITH_ORG_TOKEN in your local file before packaging it. Without JavaScript, expand the manual template below and edit its placeholders.
# Writes Speakeasy managed.json for the Intune-enrolled user, with an interactive fallback.
# Designed for Intune Win32 deployment as SYSTEM.
$ErrorActionPreference = 'Stop'
# Update the Intune detection rule when changing this value.
$configRevision = 'CONFIG_REVISION'
$template = @'
{
"v": 1,
"email": "{{mail}}",
"org_token": "REPLACE_WITH_ORG_TOKEN",
"org_slug": "example-corp",
"org_name": "Example Corp",
"auto_update": "notify"
}
'@
$dir = Join-Path $env:ProgramData 'Speakeasy'
$file = Join-Path $dir 'managed.json'
$daemon = Join-Path $env:ProgramFiles 'Speakeasy\speakeasyd.exe'
$log = Join-Path $dir 'managed-install.log'
function Write-InstallLog {
param([Parameter(Mandatory)][string]$Message)
Add-Content -LiteralPath $log `
-Value "$(Get-Date -Format 's') $Message"
}
function Test-UserEmail {
param([AllowNull()][string]$Value)
return (
-not [string]::IsNullOrWhiteSpace($Value) -and
$Value -match '^[^@\s]+@[^@\s]+\.[^@\s]+$' -and
$Value -notmatch '^(foouser|autopilot)@'
)
}
function Get-InteractiveUserContext {
$account = [string](Get-CimInstance Win32_ComputerSystem).UserName
if ([string]::IsNullOrWhiteSpace($account)) {
throw 'No interactive console user is signed in yet.'
}
try {
$ntAccount = New-Object `
-TypeName System.Security.Principal.NTAccount `
-ArgumentList $account
$sid = $ntAccount.Translate(
[System.Security.Principal.SecurityIdentifier]
).Value
}
catch {
throw "Could not resolve the SID for active user [$account]. $($_.Exception.Message)"
}
Write-InstallLog "Active console account: [$account]; SID: [$sid]."
[pscustomobject]@{
Account = $account
Sid = $sid
}
}
function Get-AadNgcUserId {
param([Parameter(Mandatory)][string]$Sid)
$base = "Registry::HKEY_USERS\$Sid\Software\Microsoft\Windows NT\CurrentVersion\WorkplaceJoin\AADNGC"
foreach ($key in @(Get-ChildItem -LiteralPath $base -Recurse -ErrorAction SilentlyContinue)) {
$candidate = [string]$key.GetValue('UserId')
if (Test-UserEmail $candidate) {
return $candidate
}
}
return $null
}
function Get-DomainUserPrincipalName {
param([Parameter(Mandatory)][string]$Sid)
$context = $null
$principal = $null
try {
Add-Type -AssemblyName System.DirectoryServices.AccountManagement -ErrorAction Stop
$context = New-Object `
System.DirectoryServices.AccountManagement.PrincipalContext(
[System.DirectoryServices.AccountManagement.ContextType]::Domain
)
$principal = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity(
$context,
[System.DirectoryServices.AccountManagement.IdentityType]::Sid,
$Sid
)
if ($principal -and (Test-UserEmail $principal.UserPrincipalName)) {
return $principal.UserPrincipalName
}
}
catch {
Write-InstallLog "AD UPN lookup did not return a usable identity: $($_.Exception.Message)"
}
finally {
if ($principal) { $principal.Dispose() }
if ($context) { $context.Dispose() }
}
return $null
}
function Get-ActiveEntraUserEmail {
$user = Get-InteractiveUserContext
# Entra-only sign-in, normally AzureAD\user@company.com.
if ($user.Account -match '^AzureAD\\(.+)$') {
$candidate = $Matches[1]
if (Test-UserEmail $candidate) {
Write-InstallLog 'Identity source: AzureAD account name.'
return $candidate
}
}
# User-specific Entra/Workplace Join record.
$candidate = Get-AadNgcUserId -Sid $user.Sid
if (Test-UserEmail $candidate) {
Write-InstallLog 'Identity source: WorkplaceJoin AADNGC UserId.'
return $candidate
}
# Hybrid AD/Entra fallback.
$candidate = Get-DomainUserPrincipalName -Sid $user.Sid
if (Test-UserEmail $candidate) {
Write-InstallLog 'Identity source: on-premises AD userPrincipalName.'
return $candidate
}
throw "Could not determine an Entra UPN for active user [$($user.Account)] (SID $($user.Sid))."
}
function Get-EnrolledUserEmail {
# The Intune enrollment UPN is readable as SYSTEM, even without a console session.
foreach ($enrollment in Get-ChildItem -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Enrollments' -ErrorAction SilentlyContinue) {
$upn = (Get-ItemProperty -LiteralPath $enrollment.PSPath -ErrorAction SilentlyContinue).UPN
if (Test-UserEmail $upn) {
Write-InstallLog 'Identity source: Intune enrollment UPN.'
return $upn
}
}
return (Get-ActiveEntraUserEmail)
}
try {
# Create this before identity detection so failed Intune runs leave a log.
New-Item -ItemType Directory -Path $dir -Force | Out-Null
Write-InstallLog "Starting. Process identity: [$env:USERDOMAIN\$env:USERNAME]."
try {
$config = $template | ConvertFrom-Json
}
catch {
# JSON parser errors can include the configuration, including the token.
throw 'Invalid configuration JSON. Check the template values before packaging this script.'
}
if ($config.org_token -like 'REPLACE_*') {
throw 'Set org_token before packaging this script.'
}
if ($config.auto_update -notin 'notify', 'automatic') {
throw 'Set auto_update to "notify" or "automatic".'
}
$config.email = Get-EnrolledUserEmail
$json = $config | ConvertTo-Json -Depth 4
[System.IO.File]::WriteAllText(
$file,
$json,
[System.Text.UTF8Encoding]::new($false)
)
& icacls.exe $dir /inheritance:r /grant `
'*S-1-5-18:(OI)(CI)F' `
'*S-1-5-32-544:(OI)(CI)F' `
'*S-1-5-32-545:(OI)(CI)RX' | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "Failed to set directory permissions. icacls exit code: $LASTEXITCODE."
}
& icacls.exe $file /inheritance:r /grant `
'*S-1-5-18:F' `
'*S-1-5-32-544:F' `
'*S-1-5-32-545:R' | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "Failed to set file permissions. icacls exit code: $LASTEXITCODE."
}
if (Test-Path $daemon) {
& $daemon -service restart
if ($LASTEXITCODE -ne 0) {
throw "speakeasyd restart failed with exit code $LASTEXITCODE."
}
}
Write-InstallLog "Configuration completed. Writing managed-$configRevision.installed marker."
Remove-Item (Join-Path $dir 'managed-*.installed') `
-Force -ErrorAction SilentlyContinue
New-Item -ItemType File `
-Path (Join-Path $dir "managed-$configRevision.installed") `
-Force | Out-Null
exit 0
}
catch {
try {
if (-not (Test-Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force | Out-Null
}
Write-InstallLog "FAILED: $($_.Exception.Message)"
}
catch {
# Preserve the original error code even if logging also fails.
}
exit 1
}
Manual deployment script template
# Writes Speakeasy managed.json for the Intune-enrolled user, with an interactive fallback.# Designed for Intune Win32 deployment as SYSTEM.$ErrorActionPreference = 'Stop'
# Update the Intune detection rule when changing this value.$configRevision = 'CONFIG_REVISION'
$template = @'{ "v": 1, "email": "{{mail}}", "org_token": "REPLACE_WITH_ORG_TOKEN", "org_slug": "example-corp", "org_name": "Example Corp", "auto_update": "AUTO_UPDATE_MODE"}'@
$dir = Join-Path $env:ProgramData 'Speakeasy'$file = Join-Path $dir 'managed.json'$daemon = Join-Path $env:ProgramFiles 'Speakeasy\speakeasyd.exe'$log = Join-Path $dir 'managed-install.log'
function Write-InstallLog { param([Parameter(Mandatory)][string]$Message)
Add-Content -LiteralPath $log ` -Value "$(Get-Date -Format 's') $Message"}
function Test-UserEmail { param([AllowNull()][string]$Value)
return ( -not [string]::IsNullOrWhiteSpace($Value) -and $Value -match '^[^@\s]+@[^@\s]+\.[^@\s]+$' -and $Value -notmatch '^(foouser|autopilot)@' )}
function Get-InteractiveUserContext { $account = [string](Get-CimInstance Win32_ComputerSystem).UserName
if ([string]::IsNullOrWhiteSpace($account)) { throw 'No interactive console user is signed in yet.' }
try { $ntAccount = New-Object ` -TypeName System.Security.Principal.NTAccount ` -ArgumentList $account
$sid = $ntAccount.Translate( [System.Security.Principal.SecurityIdentifier] ).Value } catch { throw "Could not resolve the SID for active user [$account]. $($_.Exception.Message)" }
Write-InstallLog "Active console account: [$account]; SID: [$sid]."
[pscustomobject]@{ Account = $account Sid = $sid }}
function Get-AadNgcUserId { param([Parameter(Mandatory)][string]$Sid)
$base = "Registry::HKEY_USERS\$Sid\Software\Microsoft\Windows NT\CurrentVersion\WorkplaceJoin\AADNGC"
foreach ($key in @(Get-ChildItem -LiteralPath $base -Recurse -ErrorAction SilentlyContinue)) { $candidate = [string]$key.GetValue('UserId')
if (Test-UserEmail $candidate) { return $candidate } }
return $null}
function Get-DomainUserPrincipalName { param([Parameter(Mandatory)][string]$Sid)
$context = $null $principal = $null
try { Add-Type -AssemblyName System.DirectoryServices.AccountManagement -ErrorAction Stop
$context = New-Object ` System.DirectoryServices.AccountManagement.PrincipalContext( [System.DirectoryServices.AccountManagement.ContextType]::Domain )
$principal = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity( $context, [System.DirectoryServices.AccountManagement.IdentityType]::Sid, $Sid )
if ($principal -and (Test-UserEmail $principal.UserPrincipalName)) { return $principal.UserPrincipalName } } catch { Write-InstallLog "AD UPN lookup did not return a usable identity: $($_.Exception.Message)" } finally { if ($principal) { $principal.Dispose() } if ($context) { $context.Dispose() } }
return $null}
function Get-ActiveEntraUserEmail { $user = Get-InteractiveUserContext
# Entra-only sign-in, normally AzureAD\user@company.com. if ($user.Account -match '^AzureAD\\(.+)$') { $candidate = $Matches[1]
if (Test-UserEmail $candidate) { Write-InstallLog 'Identity source: AzureAD account name.' return $candidate } }
# User-specific Entra/Workplace Join record. $candidate = Get-AadNgcUserId -Sid $user.Sid if (Test-UserEmail $candidate) { Write-InstallLog 'Identity source: WorkplaceJoin AADNGC UserId.' return $candidate }
# Hybrid AD/Entra fallback. $candidate = Get-DomainUserPrincipalName -Sid $user.Sid if (Test-UserEmail $candidate) { Write-InstallLog 'Identity source: on-premises AD userPrincipalName.' return $candidate }
throw "Could not determine an Entra UPN for active user [$($user.Account)] (SID $($user.Sid))."}
function Get-EnrolledUserEmail { # The Intune enrollment UPN is readable as SYSTEM, even without a console session. foreach ($enrollment in Get-ChildItem -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Enrollments' -ErrorAction SilentlyContinue) { $upn = (Get-ItemProperty -LiteralPath $enrollment.PSPath -ErrorAction SilentlyContinue).UPN if (Test-UserEmail $upn) { Write-InstallLog 'Identity source: Intune enrollment UPN.' return $upn } }
return (Get-ActiveEntraUserEmail)}
try { # Create this before identity detection so failed Intune runs leave a log. New-Item -ItemType Directory -Path $dir -Force | Out-Null Write-InstallLog "Starting. Process identity: [$env:USERDOMAIN\$env:USERNAME]."
try { $config = $template | ConvertFrom-Json } catch { # JSON parser errors can include the configuration, including the token. throw 'Invalid configuration JSON. Check the template values before packaging this script.' }
if ($config.org_token -like 'REPLACE_*') { throw 'Set org_token before packaging this script.' }
if ($config.auto_update -notin 'notify', 'automatic') { throw 'Set auto_update to "notify" or "automatic".' }
$config.email = Get-EnrolledUserEmail $json = $config | ConvertTo-Json -Depth 4
[System.IO.File]::WriteAllText( $file, $json, [System.Text.UTF8Encoding]::new($false) )
& icacls.exe $dir /inheritance:r /grant ` '*S-1-5-18:(OI)(CI)F' ` '*S-1-5-32-544:(OI)(CI)F' ` '*S-1-5-32-545:(OI)(CI)RX' | Out-Null
if ($LASTEXITCODE -ne 0) { throw "Failed to set directory permissions. icacls exit code: $LASTEXITCODE." }
& icacls.exe $file /inheritance:r /grant ` '*S-1-5-18:F' ` '*S-1-5-32-544:F' ` '*S-1-5-32-545:R' | Out-Null
if ($LASTEXITCODE -ne 0) { throw "Failed to set file permissions. icacls exit code: $LASTEXITCODE." }
if (Test-Path $daemon) { & $daemon -service restart
if ($LASTEXITCODE -ne 0) { throw "speakeasyd restart failed with exit code $LASTEXITCODE." } }
Write-InstallLog "Configuration completed. Writing managed-$configRevision.installed marker."
Remove-Item (Join-Path $dir 'managed-*.installed') ` -Force -ErrorAction SilentlyContinue
New-Item -ItemType File ` -Path (Join-Path $dir "managed-$configRevision.installed") ` -Force | Out-Null
exit 0}catch { try { if (-not (Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
Write-InstallLog "FAILED: $($_.Exception.Message)" } catch { # Preserve the original error code even if logging also fails. }
exit 1}2. Download the Win32 Content Prep Tool. In PowerShell on the packaging machine, download the Win32 Content Prep Tool. This requires Git. The commands clone into a temporary folder, copy out the executable to the current folder, and remove the clone:
$toolDir = Join-Path ([System.IO.Path]::GetTempPath()) ([guid]::NewGuid().ToString())try { git clone --depth 1 https://github.com/microsoft/microsoft-win32-content-prep-tool.git $toolDir if ($LASTEXITCODE -ne 0) { throw 'Could not clone the Win32 Content Prep Tool.' } Copy-Item (Join-Path $toolDir 'IntuneWinAppUtil.exe') .\IntuneWinAppUtil.exe -ErrorAction Stop} finally { if (Test-Path $toolDir) { Remove-Item $toolDir -Recurse -Force }}3. Package and upload the script as a Win32 app. Stage the script alone in an empty folder (the packer bundles the whole folder), then package it:
.\IntuneWinAppUtil.exe -c <stage-folder> -s Deploy-SpeakeasyManagedJson.ps1 -o outIn Apps → Windows → Add → Windows app (Win32), upload the .intunewin and set:
- Install command:
%windir%\sysnative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Deploy-SpeakeasyManagedJson.ps1 - Uninstall command:
cmd.exe /c rmdir /s /q "%ProgramData%\Speakeasy" - Install behavior: System
- Detection rule: a File rule checking that
managed-CONFIG_REVISION.installedexists in%ProgramData%\Speakeasy. Use the same revision as the script. Intune uses detection rules to decide whether the app is already present, so checking only formanaged.jsonwould skip later configuration revisions. - Assignments: none. As a dependency it installs wherever the agent app does.
Token rotation. Change CONFIG_REVISION, re-package the script as a new config app, and replace the old config app in the agent app’s dependency list. Do not rely on supersedence alone: Intune does not interchange a superseding Win32 app with an app dependency. The revision-specific detection rule causes Intune to run the new script, which restarts an existing service after writing the updated configuration.
Leave the icacls grants in the script as they are. The file must stay readable by Users, or enrollment silently fails.
The script first looks for a valid Intune enrollment user principal name (UPN). It can use that UPN without an interactive console session. On shared or reassigned devices, verify that the enrollment UPN belongs to the intended user: it takes precedence over the current sign-in.
For device-context enrollments, including Autopilot pre-provisioning and hybrid-joined devices that enroll with device credentials, the script ignores placeholder UPNs beginning with fooUser@ or autopilot@. If no valid enrollment UPN is available, it looks up the interactive console user through the Entra account name, the user’s Workplace Join record, or on-premises Active Directory by SID. If the fallback is needed but no interactive console user is available, the install exits without writing a new marker. Sign in as the intended user and let Intune retry. If speakeasy status already shows a placeholder email, change CONFIG_REVISION and redeploy the config app.
To troubleshoot a Windows install, check %ProgramData%\Speakeasy\managed-install.log for the identity source or failure. After Intune detects the new revision marker, run the status check as the intended user. Confirm that it reports the expected email and source: managed.
Deliver the identity file as a custom configuration profile. One profile serves the whole fleet: Intune fills in {{mail}} per device.
-
Save the following as
speakeasy-agent.mobileconfig, replacing theorg_tokenandorg_slugvalues and generating fresh UUIDs (uuidgen) for bothPayloadUUIDkeys:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>PayloadContent</key><array><dict><key>PayloadType</key><string>com.apple.ManagedClient.preferences</string><key>PayloadIdentifier</key><string>com.speakeasy.agent.preferences</string><key>PayloadUUID</key><string>REPLACE-WITH-UUID-1</string><key>PayloadVersion</key><integer>1</integer><key>PayloadContent</key><dict><key>com.speakeasy.agent</key><dict><key>Forced</key><array><dict><key>mcx_preference_settings</key><dict><key>v</key><integer>1</integer><key>email</key><string>{{mail}}</string><key>org_token</key><string>spk_org_…</string><key>org_slug</key><string>example-corp</string><key>auto_update</key><string>automatic</string></dict></dict></array></dict></dict></dict></array><key>PayloadDisplayName</key><string>Speakeasy device agent</string><key>PayloadIdentifier</key><string>com.speakeasy.agent.profile</string><key>PayloadScope</key><string>System</string><key>PayloadType</key><string>Configuration</string><key>PayloadUUID</key><string>REPLACE-WITH-UUID-2</string><key>PayloadVersion</key><integer>1</integer></dict></plist> -
In Devices → Configuration → Create → New policy, choose macOS and the Templates → Custom profile type, upload the file, and set Deployment channel to Device channel.
-
Assign it to the same group as the macOS agent app you create in Step 2.
-
Assign an idempotent macOS shell script to the same group and set Run script as signed-in user to No. Have it exit nonzero until both the managed preference and the agent are present, compare the preference file’s hash with a local last-loaded marker, and restart the console user’s daemon only when the hash changes:
launchctl kickstart -k "gui/$(id -u "$(stat -f%Su /dev/console)")/com.speakeasy.daemon". Record the marker only after a successful restart. The app and profile assignments have no documented delivery order. Configure a recurring Script frequency and retries so the script eventually reconciles initial delivery and later profile updates. Microsoft documents the available frequency and retry controls in Use shell scripts on macOS devices in Intune.
Keep {{mail}} lowercase: Intune doesn’t validate tokens, and {{Mail}} ships as a literal string. On a device, inspect the delivered profile with defaults read /Library/Managed\ Preferences/com.speakeasy.agent.
Fallback: a platform script. If the managed.json file path is required instead, use Devices → Scripts and remediations → Platform scripts → Add → macOS with a script that writes /Library/Application Support/Speakeasy/managed.json as root:wheel / 0644, then restarts the console user’s daemon. Three Intune-specific traps:
- Intune macOS scripts have no parameters and don’t expand
{{mail}}: the script has to resolve the email itself, and theorg_tokenlives in the script body. - Restart the daemon in the console user’s context, not as root:
launchctl kickstart -k "gui/$(id -u "$(stat -f%Su /dev/console)")/com.speakeasy.daemon". - Set Script frequency to a recurring interval rather than once, so rotated tokens reach devices.
Use an Intune Linux script to write /etc/speakeasy/managed.json as root:root / 0644, then follow the Linux guide to register and restart the per-user unit.
Step 2: Set up the line-of-business app
Section titled “Step 2: Set up the line-of-business app”The agent is deployed as one Intune app per platform. In Apps → All apps → Add, choose the app type for each platform in the fleet:
| Platform | App type | Installer (Step 3) |
|---|---|---|
| macOS | Line-of-business app | speakeasy-agent_<version>.pkg |
| Windows | Windows app (Win32) | speakeasy-agent_<version>.msi, wrapped as .intunewin |
On Windows, use Windows app (Win32) rather than a line-of-business MSI. The identity file from Step 1 is attached as an app dependency, and Intune only supports dependencies between Win32 apps.
Settings that are the same regardless of platform:
- Name and Publisher: use the same name on both apps (for example Speakeasy Device Agent / Speakeasy) so the dependency picker and the Company Portal both show one obvious entry per platform.
- Assignments: assign the app as Required to the device group that should run the agent. On Windows, the wizard’s Dependencies page (Step 3) comes before Assignments, so attach the identity-file app there first. Don’t assign the identity-file app from Step 1; as a dependency it installs wherever the agent app does.
Intune asks for the installer file on the first page of the wizard, so have the platform’s installer from Step 3 ready when creating each app.
Step 3: Add the installer for each platform
Section titled “Step 3: Add the installer for each platform”Windows
Section titled “Windows”-
In the dashboard, open Organization Settings → Secure → Device Agent, choose Windows under Install the agent, and download
speakeasy-agent_<version>.msi. You can also download the current one fromhttps://ai.speakeasy.com/rpc/install/device-agent-windows.msi; it redirects to the versioned file, so a browser saves it under that name. -
Stage the MSI alone in an empty folder and package it with the Win32 Content Prep Tool (
IntuneWinAppUtil.exe) from Step 1:Terminal window .\IntuneWinAppUtil.exe -c <stage-folder> -s speakeasy-agent_<version>.msi -o out -
Upload the resulting
.intunewinas the app package file for the Windows app created in Step 2, then set the Program page:- Install command:
msiexec /i speakeasy-agent_<version>.msi /qn /norestart - Uninstall command:
msiexec /x speakeasy-agent_<version>.msi /qn /norestart - Install behavior: System
- Device restart behavior: No specific action
- Install command:
-
On the Detection rules page, match the rule to the selected update owner:
- For Intune-controlled updates, use an MSI or other version-aware rule for each release so the superseding app installs the newer version.
- For agent-controlled updates, use a version-independent File rule that checks for
C:\Program Files\Speakeasy\speakeasyd.exe. An MSI ProductCode rule can become false after an automatic MajorUpgrade and make Intune offer the older package again.
-
On the Dependencies page, choose Add, select the identity-file app from Step 1, set Automatically install to Yes, and continue. Assign the agent app only after this dependency is attached.
Choose one owner for Windows updates. Keep auto_update on "notify" when Intune controls version moves through a new .intunewin that supersedes the previous one. Use "automatic" when the agent should verify and install signed MSI updates. Do not schedule both update paths at the same time. See Windows reference.
- In the dashboard, open Organization Settings → Secure → Device Agent, choose macOS under Install the agent, and download
speakeasy-agent_<version>.pkg. You can also download the current one fromhttps://ai.speakeasy.com/rpc/install/device-agent-macos.pkg; it redirects to the versioned file, so a browser saves it under that name. - Upload it as the app package file for the macOS line-of-business app created in Step 2.
Detection needs no custom rule: Intune’s app model checks the pkg’s own receipt (com.speakeasy.agent.pkg).
Install it once. With auto_update: "automatic" in the identity file (Step 1), the agent keeps the daemon, CLI, and app current on its own. Re-push the pkg only for a change to the install layout itself, not for routine releases.
Intune can’t register the agent’s per-user systemd unit from a root script, so install on Linux through configuration management: follow the Linux guide, which covers the binaries, the unit, and the root helper package. An Intune Linux script can still place the speakeasyd and speakeasy binaries in /opt/speakeasy/bin, the guide’s root-owned folder, if that helps.
Step 4: Verify on a device
Section titled “Step 4: Verify on a device”Run the agent CLI’s status command on a target device, in the enrolled user’s session. The CLI is not on PATH, so call it by full path:
- macOS:
"$HOME/Library/Application Support/Speakeasy/bin/speakeasy" status - Windows (PowerShell):
& "C:\Program Files\Speakeasy\speakeasy.exe" status - Linux:
~/.local/state/speakeasy/bin/speakeasy status, or/opt/speakeasy/bin/speakeasy statusfor a root-owned install
It should report the enrolled email with source: managed (surfaced in the agent UI as “Provisioned by IT”). If it reports source: local or source: none, the usual causes are file permissions that are too tight, the file at the wrong path, or the daemon not having restarted since the identity file was written. On Windows, the config app should also show as Installed in the agent app’s dependency status in Intune.
Step 5: Start the Windows tray UI at sign-in
Section titled “Step 5: Start the Windows tray UI at sign-in”Deploy a Startup shortcut for all users so the tray UI starts in each user’s session. Do not launch the UI from the System-context installer.
-
Save the following as
Deploy-SpeakeasyStartup.ps1:Terminal window $ErrorActionPreference = 'Stop'$startup = [Environment]::GetFolderPath('CommonStartup')$shell = New-Object -ComObject WScript.Shell$shortcut = $shell.CreateShortcut((Join-Path $startup 'Speakeasy.lnk'))$shortcut.TargetPath = 'C:\Program Files\Speakeasy\speakeasy-ui.exe'$shortcut.WorkingDirectory = 'C:\Program Files\Speakeasy'$shortcut.Save() -
Package the script alone in a Win32 app, using the Content Prep Tool from Step 1:
Terminal window .\IntuneWinAppUtil.exe -c <startup-stage-folder> -s Deploy-SpeakeasyStartup.ps1 -o out -
Upload it as a Windows app (Win32) with these settings:
- Install command:
%windir%\sysnative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Deploy-SpeakeasyStartup.ps1 - Uninstall command:
cmd.exe /c del /q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\Speakeasy.lnk" - Install behavior: System
- Detection rule: a File rule checking that
Speakeasy.lnkexists in%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup. - Assignments: none. Add this app as another dependency of the agent app, with Automatically install set to Yes.
- Install command:
-
After Intune reports the agent, identity-file app, and Startup app as installed, sign out and back in. Confirm the Speakeasy tray icon appears. The shortcut runs at sign-in, not immediately when Intune installs it.
There is currently no Microsoft Intune integration in the Speakeasy dashboard. No Entra app registration or Microsoft Graph credentials are needed for this deployment. Use Intune’s installation status and the device checks in Step 4 to verify the rollout.
Windows reference
Section titled “Windows reference”Details of the Windows install that are worth knowing but don’t change the steps above.
The service model differs from macOS. The daemon runs machine-wide as LocalSystem, not per-user, so standard users cannot stop it (better tamper resistance than the macOS Login Items toggle) while local admins can. Tool syncing still targets the active console user’s home (~/.claude, ~/.cursor, ~/.codex); with nobody signed in, the daemon idles rather than writing into the SYSTEM profile.
Version moves can be Intune-controlled or agent-controlled. For Intune-controlled updates, keep auto_update on "notify", package the newer MSI as a new .intunewin, add it as a new app version, or use Supersedence on the new app with Uninstall previous version set to No. For agent-controlled updates, use "automatic"; the daemon verifies the newer signed MSI and launches it through a detached Windows Installer process. The MSI’s MajorUpgrade stops the service, replaces the files, and starts it again without leaving an orphaned service entry. Do not schedule an Intune rollout at the same time as an automatic agent update. The MSI’s UpgradeCode is 368ec0a6-8862-4906-af34-8c3adb92c6e0, if inventory or supersedence tooling needs it.
Managed-layer enforcement needs nothing extra. Because the Windows daemon already runs as LocalSystem, it performs privileged writes in-process rather than through a separate root helper as macOS and Linux do. Setting a tool to "managed" lands its system configuration on the first reconcile, with no EnforcementPending window waiting on a package: %ProgramData%\OpenAI\Codex\requirements.toml (Codex), %ProgramData%\Cursor\hooks.json (Cursor), and %ProgramData%\ClaudeCode\managed-settings.json (Claude Code). Each is written SYSTEM-owned with a protected ACL (SYSTEM and Administrators full, Users read-only), the Windows equivalent of a root-owned 0644.
Daemon logs land in the SYSTEM profile when the agent runs as a service: C:\Windows\System32\config\systemprofile\AppData\Local\Speakeasy\Logs\. Run interactively, they go to %LOCALAPPDATA%\Speakeasy\Logs\ instead. Worth telling the support desk before they go hunting.
Scripted install without the MSI. An option for an air-gapped mirror or a custom install layout: resolve the version, URL, and SHA-256 of speakeasyd_<version>_windows_amd64.exe and speakeasy_<version>_windows_amd64.exe from the release manifest (never hardcode them), place the binaries under C:\Program Files\Speakeasy\, then run & "C:\Program Files\Speakeasy\speakeasyd.exe" -service install followed by -service start. Call it by that full path, because the folder is not on PATH. Write managed.json with the same ACL grant as the script above, restart the service on every run, and move versions by stopping the service, replacing the binaries, and starting it again. Those raw binaries are not signed, so browser downloads of them may draw a SmartScreen warning; Intune line-of-business installs are unaffected. The manifest covers the raw binaries; verify the MSI itself with Get-AuthenticodeSignature.