Here is some VBS that sets all the network settings except DNS - can't do all your work for you. I will leave it up to you to get the required object and property and turn this into Win32::OLE code if you really want. Here is a
hint You DO KNOW that the logon script will run locally so if you want it to be in perl your target machines will need perl installed or you will need to make the script and exe....
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cim
+v2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TR
+UE")
strIPAddress = Array("192.168.0.42")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.1")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask
+)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetr
+ic)
If errEnable = 0 Then
WScript.Echo "The IP address has been changed."
Else
WScript.Echo "The IP address could not be changed."
End If
Next
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print