Dynamically Changing IP address of XP machine
Hi All
Is there way changing Ip address automatically depending on users
senario is like if user A logins to XP system he should work with 'A' IP configuration
and if user 'B' logins he should work with 'B' IP configuration
How this can be achived?, i have clue
1)you can use Script
Is there any other method. if any one have readymade script i would like to study
I have sample code which changes your ip address but i dont know how to use it in my case
================================================== ====================
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("192.168.1.141")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.1.100")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
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
================================================== =====================
|