tis-disable-netbios

5
Disable netbios on all interfaces
905 downloads
Download

  Description 

  • package : tis-disable-netbios
  • version : 5
  • architecture : all
  • categories :
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • description : Disable netbios on all interfaces
  • locale :
  • target_os :
  • min_os_version :
  • max_os_version :
  • min_wapt_version :
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-02-27T21:29:45.640440

  Setup.py 

from setuphelpers import *
import wmi

uninstallkey=[]

def install():
    netcfg = wmi.WMI().win32_NetworkAdapterConfiguration
    for connection in netcfg.query(IPEnabled = True):
        if connection.TcpipNetbiosOptions != 2:
            print(u'Disabling Netbios on %s' % connection.Description)
            connection.SetTcpipNetbios(2)

def uninstall():
    netcfg = wmi.WMI().win32_NetworkAdapterConfiguration
    for connection in netcfg.query(IPEnabled = True):
        if connection.TcpipNetbiosOptions == 2:
            print(u'Enabling Netbios on %s' % connection.Description)
            connection.SetTcpipNetbios(0)

def audit():
    netcfg = wmi.WMI().win32_NetworkAdapterConfiguration
    has_netbios = []
    for connection in netcfg.query(IPEnabled = True):
        if connection.TcpipNetbiosOptions != 2:
            has_netbios.append(connection.Description)
    if has_netbios:
        print(u'ERROR: Netbios is not disabled on interfaces :\n%s'% u'\n'.join(has_netbios))
        return 'ERROR'
    else:
        return 'OK'

										

  Changelog 


No changelog
  manifest.sha256 
[["setup.py","787a74681fd5b5fc2aea4be13f2cc19f5f4cc5bd0b554d9f238024e93172b34f"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/wapt.psproj","2178f5df7dcc4581d70269b18511b13adb8ea231f06fa0c3879a7fee51af4b80"],["WAPT/control","81f0ad39cbfe6bd07b7b8a5050c853b778321e10094958125fd12581068a67e4"]]