How would I set my nic to a static IP on the same subnet as servers in my Imported CSV File?
Hello All,
i have a snippet of code like so:
$Path1 = "C:\powershell\CSV\Client_Gen9.csv"
$csv1 = Import-Csv $Path1 | Select ProdOrder, SerialNum, Model, AssetTag, ServName, ILOHostName, StaticIP, Subnet, Gateway, DOMAIN, DefaultPW, DHCPIP, SalesOrder
In that CSV file I have 10 servers with a "staticip" column. Each will be getting a static IP assigned to the port during the script.
Say my 10 servers have an IP range of 10.10.10.10 - 20 with a 24 bit subnet.
How would I have my script check the range of IP's in the working CSV file and then assign another IP on the same subnet so that they can still communicate when the server's IP's are changed?
Currently my users input the IP address that they want to assign to their local workstation. I was hoping to automate that portion.
Posted Apr 6, 2017, 4:09 PM UTC
1713