Kaspersky Security Center Automation  10.0
HRESULT IKlAkIpSubnets::AddDiapason ( [in] IKlAkParams pInfo,
[out, retval] long *  pidDiapason 
)

Add new diapason with specified attributes.

Adds new diapason with the specified attributes (see List of network diapason attributes). Error occurs if at least one of intervals/subnet intersects with any of existing intervals/subnets. Following attributes are required.

  • "KLDPNS_DN"
  • "KLDPNS_LF"
  • "KLDPNS_ScanEnabled"
  • "KLDPNS_ILS"


See JScript sample below.

	var oIpSubnets = new ActiveXObject("klakaut.KlAkIpSubnets");
	oIpSubnets.AdmServer = ...
	...
	var strSubnet = "172.17.14.0/24";
	var oIpConversions = new ActiveXObject("klakaut.KlAkIpConversions");
	//prepare intervals array
	var oIntervals = new ActiveXObject("klakaut.KlAkCollection");
	oIntervals.SetSize(1);
	oIntervals.SetAt(0, oIpConversions.ConvertSubnet(strSubnet));
	var oPars = new ActiveXObject("klakaut.KlAkParams");
	oPars.Add("KLDPNS_DN", "Test diapason - " + strSubnet); // display name
	oPars.Add("KLDPNS_ILS", oIntervals); //set intervals array
	oPars.Add("KLDPNS_LF", 3600*8); // 8 hours
	oPars.Add("KLDPNS_ScanEnabled", false); //disable network scan for subnet
	var idDiapason = oIpSubnets.AddDiapason(oPars);
Parameters:
pInfo container with diapason attributes (see List of network diapason attributes)
Return values:
pidDiapason id of new diapason

See also Creating ip subnets based on AD Site and Services sample.