How to Package a Local .NET Service as an Intune Win32 App

Step-by-step: publish a .NET Windows service, wrap it with IntuneWinAppUtil, and deploy silently via Microsoft Intune.

What you will build

You have a .NET Windows service — a background process registered with the Windows Service Control Manager. You want to deploy it to corporate devices through Microsoft Intune without logging in to each machine manually.

Intune Win32 app deployment lets you push any .exe or .msi installer silently, track install status per device, and trigger automatic re-installation if the service is ever removed.

Prerequisites

Before you start, you need:

  • A .NET service you can publish with dotnet publish
  • The Microsoft Win32 Content Prep Tool (IntuneWinAppUtil.exe)
  • An Intune licence and admin access to intune.microsoft.com

Step 1 — Publish the service

dotnet publish MyService.csproj -c Release -r win-x64 --self-contained false -o publish\

This writes your .exe, config files, and dependencies to the publish\ folder. Copy any extra assets the service needs (config templates, scripts) into the same folder now.

Step 2 — Write an install script

Intune calls a single install command. A small PowerShell script that copies files and registers the service is the cleanest approach.

# install.ps1
$dest = "C:\Program Files\MyService"
Copy-Item -Path "$PSScriptRoot\*" -Destination $dest -Recurse -Force
New-Service -Name "MyService" `
            -BinaryPathName "$dest\MyService.exe" `
            -DisplayName "My Service" `
            -StartupType Automatic
Start-Service -Name "MyService"

Store install.ps1 inside the same publish\ folder.

Step 3 — Package with IntuneWinAppUtil

IntuneWinAppUtil.exe -c publish\ -s install.ps1 -o output\
  • -c — source folder with all your files
  • -s — the setup entry point Intune will call
  • -o — where the .intunewin file is written

The tool produces install.intunewin in output\.

Step 4 — Upload and configure in Intune

Open Apps → Windows → Add in the Intune admin centre and follow these steps:

  1. App type: Windows app (Win32)
  2. Upload install.intunewin
  3. Install command: powershell.exe -ExecutionPolicy Bypass -File install.ps1
  4. Uninstall command: point to a matching uninstall.ps1
  5. Detection rules: File — check that C:\Program Files\MyService\MyService.exe exists
  6. Install behavior: System
  7. Assign to a device group and save
Use System install context for services. User context runs without the elevated permissions needed to register a Windows service.