IanTh
asked on
powershell script for setting windows ip addresses subnet and gateway and dns
been googleing for a powershell script to set up all the ip address stuff for virtual 2008 r2 in a vmware 4.1 enviroment so i can use a script for a forth coming vitual server build / migration prject
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is there any logic in the network card names?
ASKER
no its basically going to be something like a script that sets up the ip address the subnet and gateway with defaults for subnet 255.255.255.0 if nothing entered
if second nic is required press yes
insert ip adress for second nic
etc
if second nic is required press yes
insert ip adress for second nic
etc
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am trying to setup script for a vmware 2008 r2 project that I am currently working on for the next part that I am trying to script a lot to cut down on finger trouble putting wrong details in asx the gateway and dns will not change just the ip address but thde servers will have multiple nics
ASKER
didn't answer fully
Ian
Have a look at this
One line!
Also checkout Set-VMGuestNetworkInterfac e Options for DNS etc
http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-VMGuestNetworkInterface.html
Have a look at this
One line!
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>
Also checkout Set-VMGuestNetworkInterfac
http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-VMGuestNetworkInterface.html
ASKER