Feb 03 2023 06:10 AM
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 the vendor to configure static IP addressing and 4 DNS entries for each machine they image for us I was able to create a small CMD script that allows them to type in the IP, Subnet, Gateway etc etc. However I was then challenged to see if there was a way to build it in such a way where I import data from a csv, select the store number and terminal number then then it would import without needing to still enter in the IP address and reduce error. Or better yet, read the %COMPUTERNAME% and parse out the store number and terminal number as they are all unique and assigned.
Feb 05 2023 10:04 AM
Feb 06 2023 07:15 AM
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)