tis-disable-netbios 5

  • package : tis-disable-netbios
  • version : 5
  • architecture : all
  • locale :
  • description : Disable netbios on all interfaces
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-04-24 12:43:34
  • min_wapt_version :
  • min_os_version :
  • max_os_version :
  • impacted_process :

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 13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779
WAPT/wapt.psproj 2178f5df7dcc4581d70269b18511b13adb8ea231f06fa0c3879a7fee51af4b80
WAPT/control ec26811f216a209e7977ab80e523ee62cb242447f2d487ebabe33419555ed276