{"id":208621,"date":"2024-01-31T12:40:29","date_gmt":"2024-01-31T12:40:29","guid":{"rendered":"https:\/\/www.ninjaone.com\/script-hub\/recopilacion-de-datos-de-windows-10\/"},"modified":"2024-03-04T18:50:51","modified_gmt":"2024-03-04T18:50:51","slug":"recopilacion-de-datos-de-windows-10","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/es\/script-hub\/recopilacion-de-datos-de-windows-10\/","title":{"rendered":"C\u00f3mo activar o desactivar la recopilaci\u00f3n de datos de Windows 10 (script PowerShell)"},"content":{"rendered":"<p>En la era digital, la privacidad y la seguridad de los datos son primordiales. A medida que Windows 10 ha ido ganando popularidad, tambi\u00e9n lo ha hecho la preocupaci\u00f3n por sus funciones de recopilaci\u00f3n de datos. Para los profesionales de TI y los proveedores de servicios gestionados (MSP), comprender y controlar estas funciones es crucial. Este art\u00edculo profundiza en un <strong>script de PowerShell dise\u00f1ado para activar o desactivar la funci\u00f3n de recopilaci\u00f3n de datos de Windows 10<\/strong>.<\/p>\n<h2>Antecedentes<\/h2>\n<p>Windows 10, al igual que muchos sistemas operativos modernos, incorpora funciones de telemetr\u00eda y recopilaci\u00f3n de datos con el objetivo de mejorar la experiencia del usuario mediante la recopilaci\u00f3n de datos sobre patrones de uso, errores, etc. Sin embargo, por diversas razones, como la preocupaci\u00f3n por la privacidad y el cumplimiento de la normativa, los profesionales de TI y los MSP a menudo necesitan controlar estas funciones. Nuestro script para desactivar la recopilaci\u00f3n de datos de Windows 10 ofrece una forma simplificada de gestionar estos ajustes.<\/p>\n<h2>El script para desactivar la recopilaci\u00f3n de datos de Windows 10<\/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>Accede a m\u00e1s de 300 scripts en el Dojo de NinjaOne<\/p>\n<p><a href=\"https:\/\/www.ninjaone.com\/es\/prueba-gratuita-formulario\/\">Obt\u00e9n acceso<\/a><\/p>\n<\/div>\n<h2>An\u00e1lisis detallado<\/h2>\n<p>El script para desactivar la recopilaci\u00f3n de datos de Windows 10 es un cmdlet de PowerShell que activa la recopilaci\u00f3n de datos ling\u00fc\u00edsticos, el ID de publicidad y la telemetr\u00eda de Windows 10. Aqu\u00ed tienes un desglose paso a paso:<\/p>\n<ol>\n<li>Requisitos previos: el script requiere PowerShell versi\u00f3n 5.1.<\/li>\n<li>Par\u00e1metros: el script acepta un modificador opcional -Enable. Si se proporciona, activa las funciones de recopilaci\u00f3n de datos; de lo contrario, las desactiva.<\/li>\n<li>Funciones:\n<ol>\n<li>Test-IsElevated: comprueba si el script se est\u00e1 ejecutando con privilegios de administrador.<\/li>\n<li>Set-ItemProp: restablece o crea un valor de clave de registro.<\/li>\n<\/ol>\n<\/li>\n<li>Proceso:\n<ol>\n<li>En primer lugar, el script comprueba si se dispone de privilegios de administrador. Si no est\u00e1 presente, sale.<\/li>\n<li>A continuaci\u00f3n, determina si activar o desactivar las funciones en funci\u00f3n del interruptor -Enable.<\/li>\n<li>El script modifica claves de registro espec\u00edficas correspondientes a la recogida de datos ling\u00fc\u00edsticos, ID de publicidad y telemetr\u00eda.<\/li>\n<li>Tambi\u00e9n gestiona los servicios DiagTrack y dmwappushservice, relacionados con la telemetr\u00eda.<\/li>\n<li>Por \u00faltimo, activa varias tareas programadas relacionadas con la telemetr\u00eda.<\/li>\n<\/ol>\n<\/li>\n<li>Ejecuci\u00f3n: el script concluye <a href=\"https:\/\/www.ninjaone.com\/blog\/gpupdate-how-to-force-a-group-policy-update\/\">forzando una actualizaci\u00f3n de la pol\u00edtica de grupo<\/a>.<\/li>\n<\/ol>\n<h2>Posibles casos de uso<\/h2>\n<p>Imag\u00ednate un MSP que gestione las TI de un proveedor de servicios sanitarios. Debido a la normativa HIPAA, deben garantizar una fuga de datos m\u00ednima. Con este script para desactivar la recopilaci\u00f3n de datos de Windows 10, el MSP puede desactivar r\u00e1pidamente todas las funciones de recopilaci\u00f3n de datos en todos los equipos Windows 10 de la red, lo que garantiza el cumplimiento y mejora la privacidad de los datos de los pacientes.<\/p>\n<h2>Comparaciones<\/h2>\n<p>Aunque existen herramientas basadas en GUI y m\u00e9todos manuales para alternar estos ajustes, este script para desactivar la recopilaci\u00f3n de datos de Windows 10 ofrece una soluci\u00f3n m\u00e1s eficiente, repetible y escalable. Los m\u00e9todos manuales pueden llevar mucho tiempo y ser propensos a errores, sobre todo en varias m\u00e1quinas. Las herramientas GUI pueden no ofrecer la granularidad o las capacidades de automatizaci\u00f3n que ofrece un script PowerShell.<\/p>\n<h2>Preguntas frecuentes<\/h2>\n<ul>\n<li>\u00bfPuedo ejecutar este script en versiones anteriores de Windows?<br \/>\nNo, este script est\u00e1 dise\u00f1ado espec\u00edficamente para Windows 10.<\/li>\n<li>\u00bfNecesito privilegios de administrador para ejecutar el script para desactivar la recopilaci\u00f3n de datos de Windows 10?<br \/>\nS\u00ed, el script requiere derechos de administrador para modificar las claves del registro y gestionar los servicios.<\/li>\n<\/ul>\n<h2>Implicaciones<\/h2>\n<p>El uso de este script para desactivar la recopilaci\u00f3n de datos de Windows 10 puede mejorar significativamente la privacidad de los datos, especialmente en sectores con normativas estrictas. Sin embargo, deshabilitar algunas caracter\u00edsticas podr\u00eda limitar ciertas funcionalidades o mecanismos de respuesta en Windows 10. Los profesionales de TI deben sopesar las ventajas frente a las posibles limitaciones.<\/p>\n<h2>Recomendaciones<\/h2>\n<ul>\n<li>Haz siempre una copia de seguridad de la configuraci\u00f3n del registro antes de realizar cambios.<\/li>\n<li>Prueba el script en un entorno controlado antes de desplegarlo ampliamente.<\/li>\n<li>Revisa y actualiza peri\u00f3dicamente los scripts para adaptarlos a los cambios de las futuras actualizaciones de Windows 10.<\/li>\n<\/ul>\n<h2>Reflexiones finales<\/h2>\n<p>Para los profesionales de TI y los MSP, herramientas como NinjaOne pueden ser muy valiosas para <a href=\"https:\/\/www.ninjaone.com\/es\/supervision-gestion-de-endpoints\/supervision-remota-aviso-de-alertas\/\">gestionar y supervisar los entornos de TI<\/a>. Cuando se combinan con scripts como el que comentamos, pueden garantizar una infraestructura inform\u00e1tica segura, conforme a las normas y eficaz. A medida que evolucionen las funciones de recopilaci\u00f3n de datos de Windows 10, ser\u00e1 esencial contar con un conjunto de herramientas y una base de conocimientos s\u00f3lidos.<\/p>\n","protected":false},"author":35,"featured_media":207116,"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":[4265],"class_list":["post-208621","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub\/208621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/comments?post=208621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media\/207116"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media?parent=208621"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/operating_system?post=208621"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/use_cases?post=208621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}