set-dnsserverforwarder -using list of IP addresses for changes

Welcome Forums General PowerShell Q&A set-dnsserverforwarder -using list of IP addresses for changes

Viewing 2 reply threads
  • Author
    Posts
    • #275733
      Participant
      Topics: 14
      Replies: 27
      Points: 196
      Rank: Participant

      I have to make a mass change to a bunch of dns forwarders IP addresses.  My issue is I’m importing a CSV of the server and IP addresses.  When I run my code I get:

      [/crayon]

      CODE:

      [/crayon]

      I added this as you can see above to convert the value but of course I have a string of multiple IP values. Any ideas how I resolve this? As now I’m getting:

      [/crayon]

      List of data in csv:

      [/crayon]
    • #275742
      Participant
      Topics: 17
      Replies: 1951
      Points: 3,986
      Helping Hand
      Rank: Community Hero

      Assuming you are attempting to pass an array of IP addresses, then importing from a CSV will not automatically create the array. Right now you are literally passing “172.27.254.68, 172.26.1.59, 172.26.134.11” as a IP address, which it is trying to convert to a System.Net.IPAddress, which is the error you are seeing. Try splitting the IPAddress:

    • #275757
      Participant
      Topics: 14
      Replies: 27
      Points: 196
      Rank: Participant

      Rob,
      Thank you this worked perfectly!

      • This reply was modified 1 month, 2 weeks ago by lawson2312.
      • This reply was modified 1 month, 2 weeks ago by lawson2312.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.