|
Afternoon Anyone know how I can modify the following WMI script so it can be used in KIX
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") strGateway = Array("192.168.1.100") strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) Next
From what I read on the board here does this sound right
$strComputer = "." $ObjWMIservice = GetObject("winmgmts:\\"+$strComputer+"\root\cimv2") $colNetAdapters = $objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") $Gateway = ("$NDG") $GatewayMetric = (1) For Each $objNetAdapter in $colNetAdapters errGateways = objNetAdapter.SetGateways($Gateway, $Gatewaymetric) Next
Exit1
I don't want to use the array function in the above script I would rather use a kix Variable to update the Default gateway instead. Will that work ?
|