DNS entries

Glenn Maxwell 10,551 Reputation points
2023-05-11T06:05:06.4766667+00:00

Hi All

i have hardware devices and i want to create DNS entries for it. i have more than 100 entries to be added. how can do i achieve using PowerShell. i have a csv file in the below format.

devices

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,222 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 45,416 Reputation points
    2023-05-11T15:14:00.3633333+00:00

    There's no error handling in this:

    Import=CSV C:\Junk\NameAndAddress.csv |
        ForEach-Object{
            $a = $_.HostName -split "\.",2
            Add-DnsServerResourceRecordA -Name $a[0] -ZoneName $a[1] -IPv4Address $_.IPv4Address
        }
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more