Hi All
i have few windows 10 machines in a csv file. i want to set the ip from static to DHCP on these machines, how do i do it from powershell. experts guide me. my csv file is in below format
Hi All
i have few windows 10 machines in a csv file. i want to set the ip from static to DHCP on these machines, how do i do it from powershell. experts guide me. my csv file is in below format
Is your DHCP also going to be provisioning the gateway address? If it is you'll need to do two things:
Set-NetIPInterface -InterfaceAlias 'Ethernet 1' -Dhcp Enabled
and:
Get-NetIPAddress -InterfaceAlias 'Ethernet 1' | Remove-NetRoute
Also, knowing just the name of the machine isn't enough. You'll also have to provide the name of the NIC you want to change, and that may be different on each machine.
When you change the IP address you're going to be disconnected, so build that problem into the script you write.
Hi,
Have a look at this page which has details of the add-dhcpserverv4reservation command, which includes some sample scripts on how to import from a file.
Gary.
21 people are following this question.