⚡ PowerShell 5.1+

Disable Windows Telemetry

Lowers the diagnostic data Windows sends to Microsoft (requires admin). Requires an elevated (Administrator) prompt.

By WindowsScripting.com · 743 B
Set-DisableTelemetry.ps1
<#
.SYNOPSIS
    Disable Windows Telemetry.

.DESCRIPTION
    Lowers the diagnostic data Windows sends to Microsoft (requires admin). Requires an elevated (Administrator) prompt.

    Sets HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection \ AllowTelemetry to 0.

.EXAMPLE
    .\Set-DisableTelemetry.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection'

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name 'AllowTelemetry' -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Disable Windows Telemetry applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green