Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS DNS / Powershell Script Question

Status
Not open for further replies.

rvirene

Technical User
Jul 31, 2004
4
US
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:
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
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top