Solved

script to configure ipv4 nic settings on multiple computers

Posted on 2013-02-01
2
576 Views
Last Modified: 2013-02-04
Im looking for a script that can configure ipv4 nic settings on multiple windows 7 computers at the same time from one computer.  It can be a batch file or a vbs script. Thanks

example
pc-01
Connection" source = static addr = 115.109.202.54 mask = 255.255.255.224
netsh int ip set address name = "Local Area Connection" gateway = 115.109.202.33 gwmetric=1
netsh int ip set dns name = "Local Area Connection" source = static addr = 202.54.29.5
netsh int ip add dns name = "Local Area Connection" addr = 202.54.12.164

pc02
Connection" source = static addr = 115.109.202.55 mask = 255.255.255.224
netsh int ip set address name = "Local Area Connection" gateway = 115.109.202.33 gwmetric=1
netsh int ip set dns name = "Local Area Connection" source = static addr = 202.54.29.5
netsh int ip add dns name = "Local Area Connection" addr = 202.54.12.164

pc3
Connection" source = static addr = 115.109.202.56 mask = 255.255.255.224
netsh int ip set address name = "Local Area Connection" gateway = 115.109.202.33 gwmetric=1
netsh int ip set dns name = "Local Area Connection" source = static addr = 202.54.29.5
netsh int ip add dns name = "Local Area Connection" addr = 202.54.12.164
0
Comment
Question by:scriptz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
d_nedelchev earned 500 total points
ID: 38846669
Generally setting network configuration OVER THE NETWORK is not a good idea, but one thing comes to mind in this case - PsExec.

PsExec can copy a file to the remote machine and execute it, and thereby you can use those netsh commands that you posted above.

The idea is to have a "master script" containing PsExec commands for every machine that you whant to configure such as:

@echo off

PsExec \\pc-01 -u UserName -p Password -c -f -s pc-01.bat
PsExec \\pc-02 -u UserName -p Password -c -f -s pc-02.bat
PsExec \\pc-03 -u UserName -p Password -c -f -s pc-03.bat

Exit

Open in new window


And a batch script for each machine containing the netsh commands to configure the interface once the .bat file is copied on the remote computer.

You can choose to enter the passwords manually or write them down in the batch file (which is not very secure practice). Detail description of all command line switches is available on the PsExec web page.
0
 

Author Closing Comment

by:scriptz
ID: 38852726
Had to us psexec and the batch file to get the nics configured. Thanks
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question