Solved

script to configure ipv4 nic settings on multiple computers

Posted on 2013-02-01
2
572 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 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