Link to home
Start Free TrialLog in
Avatar of TeamMISCBC
TeamMISCBCFlag for United States of America

asked on

Alternate tcp/ip config on an xp laptop

Experts--

Hello, I have a laptop at work that is used at multiple offices, and I would like to let a user setup the
network configuration using the alternate configuration tab on the properties of tcp/ip.
Problem: we have some user that go back and forth between offices...and one office is setup
for static ip's ---all others are on dhcp service. How can a user traveling from one office to another (with
different network settings) and change their tcp/ip settings to the office they are located in?

Note--- all have xp pro loaded on the laptops, and the domain users have no permissions to change tcp/ip settings from their domain account.
I do see the tab for  alternate configuration in tcp/ip properties...and I have logged in as a domain administrator, and input all necessary settings. ...for the static setup, AND all settings are correct in the General tab (for dhcp usage).

So, we just need to know how to switch back and forth ---from a domain user's account--when a user travels to another office.
Thanks.

Avatar of vladh
vladh
Flag of Canada image

You can script the process and place the shortcuts to the script on the users desktop. The user can be added to local "Network Configuration Operators" group so they can edit their TCP/IP settigs without being an ADmin on the box. The following sample script below can set both primary and an alternate IP address/mask; you can play with the script to see if it works for you:
'--------------------------------------------------------------------------------------------------
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.22.100","192.168.1.141")
strSubnetMask = Array("255.255.255.0","255.255.255.0")
strGateway = Array("192.168.22.1")
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
      
'-------------------------------------------------
hope that helps
vlad
Netswitch will do this.  You can create shortcuts on the desktop, double click and all settings have changed.
http://www.adtec.it/nwdownload-en.htm
ASKER CERTIFIED SOLUTION
Avatar of Rob Williams
Rob Williams
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks TeamMISCBC.
Cheers !
--Rob