Tranquil IT recrute Tranquil IT recrute

tis-disable-netbios

Version : 5

Download
  • package : tis-disable-netbios
  • editor :
  • version : 5
  • licence :
  • architecture : all
  • locale :
  • description : Disable netbios on all interfaces
  • description_fr :
  • min_os_version :
  • max_os_version :
  • min_wapt_version :
  • installed_size :
  • impacted_process :
  • signature_date : 20180424-124332
  • maintainer : TIS <technique@tranquil-it-systems.fr>

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

"""{% trans %}No changelog.{% endtrans %}"""
			

manifest.sha256

[["setup.py", "787a74681fd5b5fc2aea4be13f2cc19f5f4cc5bd0b554d9f238024e93172b34f"], ["WAPT/certificate.crt", "13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779"], ["WAPT/wapt.psproj", "2178f5df7dcc4581d70269b18511b13adb8ea231f06fa0c3879a7fee51af4b80"], ["WAPT/control", "ec26811f216a209e7977ab80e523ee62cb242447f2d487ebabe33419555ed276"]]