tis-disable-telemetry 5

  • package : tis-disable-telemetry
  • version : 5
  • architecture : all
  • locale :
  • description : Disable windows tracking and telemetry
  • maintainer : Hübert TOUVET
  • date : 2018-08-28 20:06:51
  • min_wapt_version : 1.5
  • min_os_version : 6.1
  • max_os_version :
  • impacted_process :

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *
import wmi

uninstallkey = []

def install():
    c = wmi.WMI()
    svcs = c.Win32_Service(Name='WerSvc')
    for svc in svcs:
        if svc.Started:
            svc.StopService()
        svc.ChangeStartMode (StartMode="Disabled")

    svcs = c.Win32_Service(Name='DiagTrack')
    for svc in svcs:
        if svc.Started:
            svc.StopService()
        svc.ChangeStartMode (StartMode="Disabled")

    svcs = c.Win32_Service(Name='dmwappushservice')
    for svc in svcs:
        if svc.Started:
            svc.StopService()
        svc.ChangeStartMode (StartMode="Disabled")

    for taskname in ('Microsoft Compatibility Appraiser','ProgramDataUpdater','AitAgent'):
        try:
            run(r'schtasks /Change /TN "\Microsoft\Windows\Application Experience\%s" /DISABLE' % taskname,accept_returncodes=[0,1])
        except CalledProcessError as e:
            print(ensure_unicode(e))

    for taskname in ('Consolidator','KernelCeipTask','UsbCeip'):
        try:
            run(r'schtasks /Change /TN "\Microsoft\Windows\Customer Experience Improvement Program\%s" /DISABLE' % taskname,accept_returncodes=[0,1])
        except CalledProcessError as e:
            print(ensure_unicode(e))

    with disable_file_system_redirection():
        for kb in ('3112343','3083711','3083325','3080149','3075853','3075249','3072318','3068708','3065988','3064683','3058168','3050267',
                '3044374','3035583','3022345','2976978'):
            run_notfatal('wusa /quiet /norestart /uninstall /kb:%s' % kb,accept_returncodes=[0,2359303,87,112,3010])

    registry_setstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\DataCollection','AllowTelemetry',0,REG_DWORD)

    registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener','Start',0,REG_DWORD)
    registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener\{DD17FA14-CDA6-7191-9B61-37A28F7A10DA}','Enabled',0,REG_DWORD)

    registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\ControlSet001\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener','Start',0,REG_DWORD)
    registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener\{DD17FA14-CDA6-7191-9B61-37A28F7A10DA}','Enabled',0,REG_DWORD)
    if isfile(os.path.expandvars(r'%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl')):
        open(os.path.expandvars(r'%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl'),'wb').write('')


def audit():
    errors = []
    c = wmi.WMI()
    svcs = c.Win32_Service(Name='DiagTrack')
    for svc in svcs:
        if svc.Started:
            errors.append('error: DiagTack is started but should be stopped')
        if svc.StartMode != 'Disabled':
            errors.append('error: DiagTack start mode is not Disabled')

    if registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\DataCollection','AllowTelemetry',1) != 0:
        errors.append('error: AllowTelemetry is not 0')

    if registry_readstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener','Start',1) != 0:
        errors.append('error: AutoLogger-Diagtrack-Listener / Start is not 0')

    if errors:
        print('\n'.join(errors))
        return 'ERROR'
    else:
        return 'OK'

if __name__ == '__main__':
    update_package()


    

Changelog

No changelog
    

manifest.sha256

setup.py 8e01da2b70eecefb96a7acc92b0e34397f0e89fd3ba4a11d0a5dfc37f8cfc510
WAPT/certificate.crt 13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779
WAPT/wapt.psproj 3824006a38918a179ecd0f15962b870f0a13e70e5f97c1c3f829a97f0e0da5df
WAPT/control ea8c118c0b95071ba72eabd50077a143d8dac00f156d0c2fca77a09e1cd802eb