Azure Intune: Windows Remediations

WitnessAI Documentation
List
Start Here
Home
Discovery
Analytics
Conversations
Users
Alerts
Policy
Administration
Apps & Resources
Tutorials
Release Notes
Release Notes
November 3, 2026 WitnessAI Release
October 27, 2026 WitnessAI Release
October 20, 2026: WitnessAI Release
October 13, 2026: WitnessAI Release
September 29, 2026: WitnessAI Release
September 22, 2026: WitnessAI Release
September 15, 2026: WitnessAI Release
September 8, 2026: WitnessAI Release
September 1, 2026: WitnessAI Release
August 25, 2026: WitnessAI Release
August 18, 2026 WitnessAI Release
August 4, 2026 WitnessAI Release
July 21, 2026 WitnessAI Release
July 14, 2026 WitnessAI Release
July 9, 2026 WitnessAI Release
June 30, 2026 WitnessAI Hotfix
June 23, 2026 WitnessAI Release
June 16, 2026 WitnessAI Release
June 11, 2026 WitnessAI Release
June 4, 2026 WitnessAI Hotfix
June 2, 2026 WitnessAI Update
May 19, 2026 WitnessAI Update
April 30, 2026 WitnessAI Update
April 28, 2026 WitnessAI Update
April 23, 2026 WitnessAI Update
April 16, 2026 WitnessAI Update
April 14, 2026 WitnessAI Update
April 9, 2026 WitnessAI Update
April 2, 2026 WitnessAI Update
March 31, 2026 WitnessAI Update
March 24, 2026 WitnessAI Update
March 19, 2026 WitnessAI Update
March 17, 2026 WitnessAI Update
March 12, 2026 WitnessAI Update
March 5, 2026 WitnessAI Update
February 26, 2026 WitnessAI Update
February 24, 2026 WitnessAI Update
February 10, 2026 WitnessAI Update
January 27, 2026 WitnessAI Update
January 20, 2026 WitnessAI Update
January 13, 2026 WitnessAI Update
December 18, 2025 WitnessAI Update
December 9, 2025 WitnessAI Update
November 18, 2025 WitnessAI Update
November 25, 2025 WitnessAI Update
November 11, 2025 WitnessAI Update
October 28, 2025 WitnessAI Update
October 23, 2025 WitnessAI Update
October 9, 2025 WitnessAI Update
April 11, 2025: WitnessAI Release v2.0
Draft: November 10, 2026 WitnessAI Release
June 9, 2025: WitnessAI Update
June 23, 2025: WitnessAI Update
July 18, 2025: WitnessAI Update
September 30, 2025: WitnessAI Update
July 31, 2025: WitnessAI Update
August 12, 2025: WitnessAI Update
September 23, 2025: WitnessAI Update
October 2, 2025 WitnessAI Update
Integrations
API Reference
Administrator Guide
 

Intune Deployment Guide: Witness Anywhere (Windows Remediations)

Step-by-step guide to deploy Witness Anywhere using Microsoft Intune → Devices → Scripts and remediations → Remediations.
Intune runs the detection script on a schedule. If the device is non-compliant, Intune runs the remediation script (device registration).

Prerequisites

  • Windows devices enrolled in Intune
  • Access to the Witness console to download the device registration bundle (see Section 1)
  • Scripts from the remediation_scripts folder of the downloaded bundle:
    • Detection: ps1: PAC/registry checks; also includes stunnel health checks if STunnel was enabled when the bundle was downloaded
    • Remediation: ps1: Witness Anywhere registration / install script
  • An interactive user logged on during remediation

1. Download the remediation bundle from the Witness console

  1. In the Witness console, open the Download Device Registration Script dialog.
  2. Configure the download options:
  • Platform: select Intune (Windows).
  • Static Domain (Optional): enter the static domain if one is used for your tenant (e.g. ai).
  • STunnel (Optional): this toggle controls what the generated detection script validates:
    • Enabled: the detection script includes stunnel health logic: it verifies that stunnel is installed under the user profile, the process is running, and it is listening as expected, in addition to the PAC/registry checks.
    • Disabled: the detection script contains no stunnel logic and validates only the Witness Anywhere PAC/registry configuration.
  1. Click Download.
notion image
  1. Extract the downloaded bundle. It contains two folders: platform_scripts and remediation_scripts.
notion image
  1. For this deployment, use the scripts from the remediation_scripts folder: detection.ps1 and register_device.ps1. These are the two files uploaded to the Intune remediation package in Section 4. (The folder also contains flush.ps1, which is not used in the remediation package.)
notion image

2. Create the remediation package

  1. Open Microsoft Intune admin center
  2. Go to Devices → Scripts and remediations
  3. Select the Remediations tab
  4. Click + Create → create a custom script package
notion image

3. Basics

  1. Enter the Name, Description, and Publisher information as shown below, then click Next.
Field
Recommended value
Notes
Name
Witness Anywhere Registration
Description
Detect Witness Anywhere configuration and automatically remediate by registering the device when required.
Helps operators identify purpose later
Publisher
Your name / team
notion image

4. Settings

  1. Upload the following scripts (from the remediation_scripts folder of the downloaded bundle):
    • Detection script: ps1
    • Remediation script: ps1
  2. Configure the script settings as follows:
    • Run this script using the logged-on credentials: No (runs as the SYSTEM account to perform privileged operations such as certificate installation, stunnel deployment, and other system-level configuration changes)
    • Enforce script signature check: No
    • Run script in 64-bit PowerShell: No
    • Click Next to proceed
notion image

5. Scope tags

Leave Default unless your tenant uses custom scope tags. Click Next.

6. Assignments

  • Configure the assignment settings:
    • Assign to: Select the target Windows device group(s).
    • Schedule: Set the schedule to Hourly for faster deployment and self-healing.
    • Filter: (Optional) Apply a filter, such as Windows 10/11 devices only.
    • Click Next to proceed
notion image

7. Review + create

  • Review the configuration, then click Create to deploy the Intune remediation package.
notion image
The package appears under Devices → Scripts and remediations → Remediations with status Active once assigned.

8. How Intune uses the scripts

Every schedule interval (e.g. hourly)
│
▼
detection.ps1
│
├── exit 0 → Compliant → stop (no remediation)
│
└── exit 1 → Non-compliant → run register_device.ps1

Detection checks

  1. WitnessAI registry has PAC_URL + DEVICE_FINGERPRINT for the logged-on user
  2. Internet Settings AutoConfigURL matches that PAC_URL
  3. stunnel.exe / stunnel.conf under the user profile (only if STunnel was enabled at download)
  4. stunnel process running (only if STunnel was enabled at download)
  5. Listening on 127.0.0.1:9411 (only if STunnel was enabled at download)
Note: if the bundle was downloaded with STunnel disabled, checks 3 to 5 are not present in the detection script and only the PAC/registry checks (1 and 2) are performed.

Remediation behavior

  • Registers the device with PEAS (if not already registered)
  • Installs root CA, sets PAC proxy / AutoConfigURL
  • Deploys stunnel (when the bundle was downloaded with STunnel enabled)
  • If already registered, re-enforces app configs

9. Validate on a device

After the schedule runs (or after a sync), on the Windows endpoint check:
C:\Windows\Temp\intune-witness-remediation.log
Look for:
  • [DETECTION] or [DETECTION_STUNNEL]: RUN START / RESULT=Compliant or NonCompliant
  • [REMEDIATION]: RUN START / RESULT=Success or Failed
Detailed registration transcript:
C:\Windows\Temp\pac-registration-log.txt
Also confirm in Windows Settings → Network & internet → Proxy that Use setup script is on and points at the Witness PAC URL when remediation succeeds.
Note: In some cases, even though detection and remediation complete successfully on the device, the Intune console fails to report the result on subsequent runs. If the console does not show an updated status, rely on the device-side logs below to confirm that detection and remediation actually ran.