tis-disable-netbios

5
Disable netbios on all interfaces
1632 downloads
Download
default icon

  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_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.txt.
									
  manifest.sha256