DNS entries

Glenn Maxwell 13,121 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

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Answer accepted by question author
  1. Rich Matheisen 47,951 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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.