?
Solved

script to configure ipv4 nic settings on multiple computers

Posted on 2013-02-01
2
Medium Priority
?
577 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

771 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