Solved

script to configure ipv4 nic settings on multiple computers

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now