×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MS DNS / Powershell Script Question

MS DNS / Powershell Script Question

MS DNS / Powershell Script Question

(OP)
Greetings,

I am trying to use the following Powershell code to bulk import DNS A records into Windows 2008 DNS:
Import-Csv .\thosts.csv | foreach{Add-DnsServerResourceRecordA -Name $_.name -ZoneName xxxxx.com -AllowUpdateAny -CreatePtr -IP $_.ip -Computername xxxxxxx}

My CSV file looks like this:
Name, IP
ABQVMP01, 130.77.129.237

It runs successfully, but the DNS name ends up being ABQVMP01.xxxxx.com.xxxxx.com, instead of ABQVMP01.xxxxx.com. I have looked for something to control this in the command syntax, but do not see anything: https://docs.microsoft.com/en-us/powershell/module...

We are running AD and DNS at the 2008 level. Powershell is version 5.1. I am running this as a domain admin.

Thanks in advance and happy to answer any more questions,
Rick

RE: MS DNS / Powershell Script Question

1. Have you tried using the FQDN ABQVMP01.xxxxx.com in the CVS file?
2. It is never a good idea to reveal your public IP addresses in forums and such.

RE: MS DNS / Powershell Script Question

(OP)
Hi Iggsterman,

Thanks for taking time to respond.

FQDN in the CSV does not work, but using the -IPV4Address switch vs. -IP did tjhe trick.

(The IP is private)

Regards,
Rick

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close