{"id":809289,"date":"2026-05-18T06:57:24","date_gmt":"2026-05-18T06:57:24","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=809289"},"modified":"2026-05-18T06:57:24","modified_gmt":"2026-05-18T06:57:24","slug":"enable-disable-windows-10-data-collection-powershell","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/pt-br\/script-hub\/enable-disable-windows-10-data-collection-powershell\/","title":{"rendered":"Como ativar ou desativar a coleta de dados do Windows 10 (script do PowerShell)"},"content":{"rendered":"<p>Na era digital, a privacidade e a seguran\u00e7a dos dados tornaram-se primordiais. Com o aumento da popularidade do Windows 10, tamb\u00e9m aumentaram as preocupa\u00e7\u00f5es com seus recursos de coleta de dados. Para os profissionais de TI e <a href=\"https:\/\/www.ninjaone.com\/what-is-an-msp\/\">os provedores de servi\u00e7os gerenciados (MSPs)<\/a>, \u00e9 fundamental compreender e controlar esses recursos. Este artigo se aprofunda em um <strong>script do PowerShell projetado para ativar ou desativar os<\/strong> recursos <strong>de coleta de dados do Windows 10<\/strong>.<\/p>\n<h2>Hist\u00f3rico<\/h2>\n<p>O Windows 10, como muitos sistemas operacionais modernos, tem recursos integrados de telemetria e coleta de dados. Eles t\u00eam o objetivo de melhorar a experi\u00eancia do usu\u00e1rio coletando dados sobre padr\u00f5es de uso, erros e muito mais. No entanto, por v\u00e1rios motivos, incluindo preocupa\u00e7\u00f5es com a privacidade e conformidade normativa, os profissionais de TI e os MSPs geralmente precisam controlar esses recursos. O script fornecido oferece uma maneira simplificada de gerenciar essas configura\u00e7\u00f5es.<\/p>\n<h2>O roteiro<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Enables or Disabled Windows 10 Linguistic Data Collection, Advertising ID, and Telemetry\r\n.DESCRIPTION\r\n    Enables or Disabled Windows 10 Linguistic Data Collection, Advertising ID, and Telemetry\r\n.EXAMPLE\r\n    No Params needed to Disable Windows 10 Linguistic Data Collection, Advertising ID, and Telemetry\r\n.EXAMPLE\r\n     -Enable\r\n    Enables Linguistic Data Collection, Advertising ID, and Telemetry\r\n.EXAMPLE\r\n    PS C:&gt; Set-Windows10KeyLogger.ps1\r\n    Disables Windows 10 Linguistic Data Collection, Advertising ID, and Telemetry\r\n.EXAMPLE\r\n    PS C:&gt; Set-Windows10KeyLogger.ps1 -Enable\r\n    Enables Windows 10 Linguistic Data Collection, Advertising ID, and Telemetry\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 10\r\n    Release Notes:\r\n    Initial Release\r\nBy using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/terms-of-use.\r\n    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. \r\n    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. \r\n    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. \r\n    Warranty Disclaimer: The script is provided \u201cas is\u201d and \u201cas available\u201d, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. \r\n    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. \r\n    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. \r\n    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).\r\n.COMPONENT\r\n    OSSecurity\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [Switch]\r\n    $Enable\r\n)\r\n\r\nbegin {\r\n    function Test-IsElevated {\r\n        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()\r\n        $p = New-Object System.Security.Principal.WindowsPrincipal($id)\r\n        if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))\r\n        { Write-Output $true }\r\n        else\r\n        { Write-Output $false }\r\n    }\r\n    function Set-ItemProp {\r\n        param (\r\n            $Path,\r\n            $Name,\r\n            $Value,\r\n            [ValidateSet('DWord', 'QWord', 'String', 'ExpandedString', 'Binary', 'MultiString', 'Unknown')]\r\n            $PropertyType = 'DWord'\r\n        )\r\n        New-Item -Path $Path -Force | Out-Null\r\n        if ((Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue)) {\r\n            Set-ItemProperty -Path $Path -Name $Name -Value $Value -Force -Confirm:$false | Out-Null\r\n        }\r\n        else {\r\n            New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType $PropertyType -Force -Confirm:$false | Out-Null\r\n        }\r\n    }\r\n    $Type = \"DWORD\"\r\n}\r\nprocess {\r\n    if (-not (Test-IsElevated)) {\r\n        Write-Error -Message \"Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    $Value = if ($PSBoundParameters.ContainsKey(\"Enable\") -and $Enable) { 1 }else { 0 }\r\n\r\n    try {\r\n        @(\r\n            # Linguistic Data Collection\r\n            [PSCustomObject]@{\r\n                Path = \"HKLM:SOFTWAREMicrosoftWindowsCurrentVersionPoliciesTextInput\"\r\n                Name = \"AllowLinguisticDataCollection\"\r\n            }\r\n            # Advertising ID\r\n            [PSCustomObject]@{\r\n                Path = \"HKLM:SOFTWAREMicrosoftWindowsCurrentVersionAdvertisingInfo\"\r\n                Name = \"Enabled\"\r\n            }\r\n            # Telemetry\r\n            [PSCustomObject]@{\r\n                Path = \"HKLM:SOFTWAREPoliciesMicrosoftWindowsDataCollection\"\r\n                Name = \"AllowTelemetry\"\r\n            }\r\n        ) | ForEach-Object {\r\n            Set-ItemProp -Path $_.Path -Name $_.Name -Value $Value -PropertyType $Type\r\n            Write-Host \"$($_.Path)$($_.Name) set to $(Get-ItemPropertyValue -Path $_.Path -Name $_.Name)\"\r\n        }\r\n\r\n        if ($PSBoundParameters.ContainsKey(\"Enable\") -and $Enable) {\r\n            Write-Host \"Enabling DiagTrack Services\"\r\n            Get-Service -Name DiagTrack | Set-Service -StartupType Automatic | Start-Service\r\n        }\r\n        else { \r\n            Write-Host \"Disabling DiagTrack Services\"\r\n            Get-Service -Name DiagTrack | Set-Service -StartupType Disabled | Stop-Service\r\n        }\r\n\r\n        Write-Host \"DiagTrack Service status: $(Get-Service -Name DiagTrack | Select-Object -Property Status -ExpandProperty Status)\"\r\n        Write-Host \"DiagTrack Service is set to: $(Get-Service -Name dmwappushservice | Select-Object -Property StartType -ExpandProperty StartType)\"\r\n\r\n        if ($PSBoundParameters.ContainsKey(\"Enable\") -and $Enable) {\r\n            Get-Service -Name dmwappushservice | Set-Service -StartupType Manual\r\n        }\r\n        else { \r\n            Get-Service -Name dmwappushservice | Set-Service -StartupType Disabled | Stop-Service\r\n        }\r\n\r\n        Write-Host \"dmwappushservice Service status: $(Get-Service -Name dmwappushservice | Select-Object -Property Status -ExpandProperty Status)\"\r\n        Write-Host \"dmwappushservice Service is set to: $(Get-Service -Name dmwappushservice | Select-Object -Property StartType -ExpandProperty StartType)\"\r\n\r\n        $tasks = \"SmartScreenSpecific\", \"ProgramDataUpdater\", \"Microsoft Compatibility Appraiser\", \"AitAgent\", \"Proxy\", \"Consolidator\",\r\n        \"KernelCeipTask\", \"BthSQM\", \"CreateObjectTask\", \"WinSAT\", #\"Microsoft-Windows-DiskDiagnosticDataCollector\", # This is disabled by default\r\n        \"GatherNetworkInfo\", \"FamilySafetyMonitor\", \"FamilySafetyRefresh\", \"SQM data sender\", \"OfficeTelemetryAgentFallBack\",\r\n        \"OfficeTelemetryAgentLogOn\"\r\n        \r\n        if ($PSBoundParameters.ContainsKey(\"Enable\") -and $Enable) {\r\n            Write-Host \"Enabling telemetry scheduled tasks\"\r\n            $tasks | ForEach-Object {\r\n                Write-Host \"Enabling $_ Scheduled Task\"\r\n                # Note: ErrorAction set to SilentlyContinue so as to skip over any missing tasks. Enable-ScheduledTask will still error if it can't be enabled.\r\n                Get-ScheduledTask -TaskName $_ -ErrorAction SilentlyContinue | Enable-ScheduledTask\r\n                $State = Get-ScheduledTask -TaskName $_ -ErrorAction SilentlyContinue | Select-Object State -ExpandProperty State\r\n                Write-Host \"Scheduled Task: $_ is $State\"\r\n            }\r\n        }\r\n        else { \r\n            Write-Host \"Disabling telemetry scheduled tasks\"\r\n            $tasks | ForEach-Object {\r\n                Write-Host \"Disabling $_ Scheduled Task\"\r\n                # Note: ErrorAction set to SilentlyContinue so as to skip over any missing tasks. Disable-ScheduledTask will still error if it can't be disabled.\r\n                Get-ScheduledTask -TaskName $_ -ErrorAction SilentlyContinue | Disable-ScheduledTask\r\n                $State = Get-ScheduledTask -TaskName $_ -ErrorAction SilentlyContinue | Select-Object State -ExpandProperty State\r\n                Write-Host \"Scheduled Task: $_ is $State\"\r\n            }\r\n        }\r\n    }\r\n    catch {\r\n        Write-Error $_\r\n        exit 1\r\n    }\r\n    \r\n    gpupdate.exe \/force\r\n    exit 0\r\n}\r\nend {}<\/pre>\n<p>&nbsp;<\/p>\n\n<div class=\"in-context-cta\"><p>Acesse mais de 300 scripts no NinjaOne Dojo<\/p>\n<p><a href=\"https:\/\/www.ninjaone.com\/freetrialform\/\">Obter acesso<\/a><\/p>\n<\/div>\n<h2>Detalhamento<\/h2>\n<p>O script \u00e9 um cmdlet do PowerShell que alterna a coleta de dados lingu\u00edsticos, a ID de publicidade e a telemetria do Windows 10. Aqui est\u00e1 um detalhamento passo a passo:<\/p>\n<ol>\n<li>Pr\u00e9-requisitos: O script requer a <a href=\"https:\/\/www.ninjaone.com\/pt-br\/script-hub\/atualizacao-do-powershell-para-a-versao-5-1\/\">vers\u00e3o 5.1 do PowerShell<\/a>.<\/li>\n<li>Par\u00e2metros: O script aceita uma chave opcional -Enable. Se fornecido, ele ativa os recursos de coleta de dados; caso contr\u00e1rio, ele os desativa.<\/li>\n<li>Fun\u00e7\u00f5es:\n<ul style=\"list-style-type: disc;\">\n<li>Test-IsElevated: Verifica se o script est\u00e1 sendo executado com privil\u00e9gios de administrador.<\/li>\n<li>Set-ItemProp: Define ou cria um valor de chave de registro.<\/li>\n<\/ul>\n<\/li>\n<li>Processo:\n<ul style=\"list-style-type: disc;\">\n<li>Primeiro, o script verifica se h\u00e1 privil\u00e9gios de administrador. Se n\u00e3o estiver presente, ele \u00e9 encerrado.<\/li>\n<li>Em seguida, ele determina se deve ativar ou desativar os recursos com base na chave -Enable.<\/li>\n<li>O script modifica chaves de registro espec\u00edficas correspondentes \u00e0 coleta de dados lingu\u00edsticos, \u00e0 ID de publicidade e \u00e0 telemetria.<\/li>\n<li>Ele tamb\u00e9m gerencia os servi\u00e7os DiagTrack e dmwappushservice, que est\u00e3o relacionados \u00e0 telemetria.<\/li>\n<li>Por fim, ele alterna v\u00e1rias tarefas agendadas relacionadas \u00e0 telemetria.<\/li>\n<\/ul>\n<\/li>\n<li>Execu\u00e7\u00e3o: O script \u00e9 conclu\u00eddo <a href=\"https:\/\/www.ninjaone.com\/blog\/gpupdate-how-to-force-a-group-policy-update\/\">for\u00e7ando uma atualiza\u00e7\u00e3o da pol\u00edtica de grupo<\/a>.<\/li>\n<\/ol>\n<h2>Casos de uso em potencial<\/h2>\n<p>Imagine um MSP gerenciando a TI de um provedor de servi\u00e7os de sa\u00fade. Devido \u00e0s normas <a href=\"https:\/\/www.ninjaone.com\/blog\/hipaa-compliance\/\">da HIPAA<\/a>, eles precisam garantir o m\u00ednimo de vazamento de dados. Usando esse script, o MSP pode desativar rapidamente todos os recursos de coleta de dados em todos os computadores com Windows 10 na rede, garantindo a conformidade e aumentando a privacidade dos dados dos pacientes.<\/p>\n<h2>Compara\u00e7\u00f5es<\/h2>\n<p>Embora existam ferramentas baseadas em GUI e m\u00e9todos manuais para alternar essas configura\u00e7\u00f5es, esse script oferece uma solu\u00e7\u00e3o mais eficiente, repet\u00edvel e dimension\u00e1vel. Os m\u00e9todos manuais podem ser demorados e propensos a erros, especialmente em v\u00e1rias m\u00e1quinas. As ferramentas de GUI podem n\u00e3o oferecer a granularidade ou os recursos de automa\u00e7\u00e3o que um script do PowerShell oferece.<\/p>\n<h2>Implica\u00e7\u00f5es<\/h2>\n<p>O uso desse script pode aumentar significativamente a privacidade dos dados, especialmente em setores com normas r\u00edgidas. No entanto, a desativa\u00e7\u00e3o de alguns recursos pode limitar determinadas funcionalidades ou mecanismos de feedback no Windows 10. Os profissionais de TI devem pesar os benef\u00edcios em rela\u00e7\u00e3o \u00e0s poss\u00edveis limita\u00e7\u00f5es.<\/p>\n<h2>Recomenda\u00e7\u00f5es<\/h2>\n<ul>\n<li>Sempre <a href=\"https:\/\/www.ninjaone.com\/blog\/back-up-and-restore-windows-registry\/\" target=\"_blank\" rel=\"noopener\">fa\u00e7a backup das<\/a> configura\u00e7\u00f5es <a href=\"https:\/\/www.ninjaone.com\/blog\/back-up-and-restore-windows-registry\/\" target=\"_blank\" rel=\"noopener\">do registro<\/a> antes de fazer altera\u00e7\u00f5es.<\/li>\n<li>Teste o script em um ambiente controlado antes de implement\u00e1-lo amplamente.<\/li>\n<li>Revise e atualize regularmente os scripts para acomodar quaisquer altera\u00e7\u00f5es em futuras atualiza\u00e7\u00f5es do Windows 10.<\/li>\n<\/ul>\n<h2>Considera\u00e7\u00f5es finais<\/h2>\n<p>Para profissionais de TI e MSPs, ferramentas como o <a href=\"https:\/\/ninjaone.com\/\" target=\"_blank\" rel=\"noopener\">NinjaOne<\/a> podem ser valiosas para <a href=\"https:\/\/www.ninjaone.com\/pt-br\/endpoint-management\/monitoramento-remoto-e-alertas\/\">gerenciar e monitorar ambientes de TI<\/a>. Quando combinados com scripts como o discutido, eles podem garantir uma infraestrutura de TI segura, compat\u00edvel e eficiente. \u00c0 medida que os recursos de coleta de dados do Windows 10 evoluem, ter um conjunto robusto de ferramentas e uma base de conhecimento ser\u00e1 essencial para o sucesso.<\/p>\n","protected":false},"author":35,"featured_media":142483,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","_lmt_disableupdate":"no","_lmt_disable":""},"operating_system":[4212],"use_cases":[12456],"class_list":["post-809289","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/script_hub\/809289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/comments?post=809289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/media\/142483"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/media?parent=809289"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/operating_system?post=809289"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/pt-br\/wp-json\/wp\/v2\/use_cases?post=809289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}