best way of setting up ip addresses with a script like netsh -f for instance

I am working on a 2008 r2 vmware server build project and wanted to know if there is a way to script the ip setting including dns primary and secondary additional dns ip addresses , nic  hostname additional nic if required

been googleing netsh but not found much I am sure somebody on ee has already done this
I am doing this to avoid finger problem inputting wrong dns etc by embeddiong them in the script so only the last octet is changed by having the first three octets in the script

it for vsphere 4.1 by the way  
LVL 30
IanThAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Do you not have access to vCenter to deploy templates, as part of the Customization Specifications?
0
IanThAuthor Commented:
yes I am using templates I have set dns and some other stuff in the template but I was thinking of scripting it as I have worked on numerous projects like this and this one is going to use multiple nics on the server and use the first three octets and just get the build engineer to put in the 4th octet from their build sheet and embed all the dns gateway subnet

as using a vmware template i can not insert the three first octets and leave the forth  thats why I think scripting would be better

 
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Ok! It you want to make it idiot proof for your "Engineers".

Personally, we prefer the "hands-on" approach, and give the Engineers back a "little bit of skill", otherwise they get bored, and QA then suffers!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

IanThAuthor Commented:
it will have to be mind you I have found a vb function for setting ip addresses so I have embeded dns settings and additional dns ip addresses so all I need is a set ip address so tonight I am going to do a vb app hopefully for setting ip address, subnet mask and gateway
0
IanThAuthor Commented:
still testing
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
you can set the IP address via vCLI
0
IanThAuthor Commented:
vcli ?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Powershell, VMware Powershell
0
IanThAuthor Commented:
never heard of vcli just powercli

never used it before got a good link for doing that ?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Get-VM VMName | Get-VMGuestNetworkInterface -GuestUser Administrator -GuestPassword <password> -HostUser root -HostPassword <password> | Set-VMGuestNetworkInterface -IPPolicy Static -Ip <IPAddress> -Netmask 255.255.252.0 -Gateway <Gateway> -GuestUser Administrator -GuestPassword <password> -HostUser root -HostPassword <password>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the above, will set an IP address in a VM using PowerCLI, here is the syntax for

Set-VMGuestNetworkInterface

http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-VMGuestNetworkInterface.html
0
IanThAuthor Commented:
it didn't actually work as #i planned on my next similar project I will use the vcli method you told me about

thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.