Sometimes you might need to load multiple static DNS records into your DNS server, especially when you have to add multiple new servers into your environment. You can do it manually, but it can take a long time and it would be very boring repetitive task, not to mention key-in errors.
With PowerShell the same task can be achieved in seconds.
Step 1 – Prepare Excel data and save as comma delimited file
- Name – The same of the server record you want to add
- IPv4Address – IP address of the server record
- ComputerName – DNS server IP Address
- ZoneName – Forward Lookup Zone
- CreatePrt – Yes to create Reverse lookup address, No not to create Reverse look up
Save all data as Comme Deliter file (.csv) and if you open with notepad you should have similar to the screenshot below. Don’t worry if you have a different delimiter, because you can specify delimiter when you run the script.
Step 2- Copy the script and execute
Create a new file using your favorite text editor with the file extension .ps1 and paste the copied script.
When you run the script first you will be asked to enter your a file delimiter. After you enter delimiter then press enter.
Select comma delimited file and click open
In the screenshot below shows records that have been processed, in total 11 records from the comma delimiter file (.csv).
Green color indicates that one record was specified not to create reverse lookup record in the comma delimiter file.
Leave A Comment