A simple PowerShell script to block Windows telemetry data collection. Works on Windows 10 and 11.
- Disables telemetry-related scheduled tasks
- Disables telemetry services
- Creates firewall rules to block telemetry executables
- Download
Telemetry-blocker.ps1 - Right-click the script
- Select "Run with PowerShell"
- Click "Yes" when prompted for administrator privileges
The script blocks these telemetry components:
- Microsoft Compatibility Appraiser
- Program Data Updater
- Startup Application Task
- Connected User Experiences and Telemetry (DiagTrack)
- WAP Push Message Routing Service
- CompatTelRunner.exe
- DiagTrack.exe
- Windows 10 or 11
- PowerShell 5.1 or newer
- Administrator privileges
#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")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.