Forum Discussion
Franzie3
Feb 03, 2023Copper Contributor
Using Powershell to configure IP addressing by importing CSV
Hi All, New to powershell and just getting my feet wet. I've been tasked with trying to automate an image process for a vendor as much as possible for a retail environment. Rather then rely on ...
Feb 05, 2023
You can create a CSV with those values and import them if the CSV has a Computername and on the same line all the other values. You could do a $list=import-csv .\pathtoCSV\filename.csv and use a $list | where-object ComputerName -eq nameofcomputer. I need more information on how you do this already. Does the CMD script also set anything, or is it just for gathering information?
Franzie3
Feb 06, 2023Copper Contributor
Currently in my cmd file i'm using set /p to have IP, subnet, and gateway entered and then using netsh to set the IP based on those values. i'm thne using wmic nicconfig to set the 4 DNS records. It works and it might be fine, but if I can simply import the csv with all the values preset, then pick a specific record to tie into what the static configuration might be then it could leave out some human error.
the CSV would have STORE, GATEWAY, SUBNET, REG1, REG2, REG3, etc etc. computername would already be set an unique per machine as XXXXXRYYY where X= 5 digit store and Y = 3 digit register (001, 002, etc)