[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

script to configure ipv4 nic settings on multiple computers

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 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