Skip to content

Windows Telemetry Blocker: A simple PowerShell script to block Windows telemetry data collection. Works on Windows 10 and 11.

License

Notifications You must be signed in to change notification settings

hypnwtykvmpr/Telemetry-Blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Windows Telemetry Blocker

A simple PowerShell script to block Windows telemetry data collection. Works on Windows 10 and 11.

What it does

  1. Disables telemetry-related scheduled tasks
  2. Disables telemetry services
  3. Creates firewall rules to block telemetry executables

Usage

  1. Download Telemetry-blocker.ps1
  2. Right-click the script
  3. Select "Run with PowerShell"
  4. Click "Yes" when prompted for administrator privileges

Actions Performed

The script blocks these telemetry components:

Scheduled Tasks

  • Microsoft Compatibility Appraiser
  • Program Data Updater
  • Startup Application Task

Services

  • Connected User Experiences and Telemetry (DiagTrack)
  • WAP Push Message Routing Service

Executables (via Firewall)

  • CompatTelRunner.exe
  • DiagTrack.exe

Requirements

  • Windows 10 or 11
  • PowerShell 5.1 or newer
  • Administrator privileges

Code

#Requires -RunAsAdministrator

# Self-elevate if needed
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
    Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
    exit
}

# Tasks to disable
$tasks = @(
    "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser",
    "\Microsoft\Windows\Application Experience\ProgramDataUpdater",
    "\Microsoft\Windows\Application Experience\StartupAppTask"
)

# Services to disable
$services = @("DiagTrack", "dmwappushservice")

# Executables to block
$executables = @(
    "C:\Windows\System32\CompatTelRunner.exe",
    "C:\Windows\System32\DiagTrack.exe"
)

Write-Host "Windows Telemetry Blocker" -ForegroundColor Cyan

# Disable tasks

Write-Host "`nDisabling scheduled tasks..." -ForegroundColor Green
foreach ($task in $tasks) {
    try {
        $taskName = ($task -split '\\')[-1]
        $taskPath = ($task -split $taskName)[0]
        Disable-ScheduledTask -TaskName $taskName -TaskPath $taskPath -ErrorAction Stop | Out-Null
        Write-Host "Disabled: $task" -ForegroundColor Green
    } catch {
        Write-Warning "Could not disable: $task"
    }
}

# Disable services
Write-Host "`nDisabling services..." -ForegroundColor Green
foreach ($service in $services) {
    try {
        Stop-Service -Name $service -Force -ErrorAction Stop
        Set-Service -Name $service -StartupType Disabled -ErrorAction Stop
        Write-Host "Disabled: $service" -ForegroundColor Green
    } catch {
        Write-Warning "Could not disable: $service"
    }
}

# Create firewall rules
Write-Host "`nCreating firewall rules..." -ForegroundColor Green
foreach ($exe in $executables) {
    if (Test-Path $exe) {
        foreach ($direction in @("Inbound", "Outbound")) {
            try {
                New-NetFirewallRule -DisplayName "Block Telemetry $direction" `
                                  -Direction $direction `
                                  -Program $exe `
                                  -Action Block | Out-Null
                Write-Host "Created $direction rule for: $exe" -ForegroundColor Green
            } catch {
                Write-Warning "Could not create $direction rule for: $exe"
            }
        }
    }
}

Write-Host "`nPress any key to exit..." -ForegroundColor Cyan
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

MIT License

Copyright (c) 2025

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Windows Telemetry Blocker: A simple PowerShell script to block Windows telemetry data collection. Works on Windows 10 and 11.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published