PowerShell gurus,
We are running Windows Server 2012 R2 with PowerShell v4.0 and want to take advantage of the new Add-DnsServerResourceRecordA and Add-DnsServerResourceRecordPTR cmdlets (and remove-dnsserverresourcerecord) to automate as much as possible the creation/deletion of statically configured DNS records.
Question: how can I combine these two cmdlets to run to create the DNS 'A' and DNS 'PTR' records in one long cmdlet? How would we make it so we can run both of these below together as one cmdlet?
Add-DnsServerResourceRecordA -Name "hostname123" -ZoneName "contoso.com" -AllowUpdateAny -IPv4Address "192.168.0.123" -TimeToLive 01:00:00
Add-DnsServerResourceRecordPtr -Name "123" -ZoneName "0.168.192.in-addr.arpa" -AllowUpdateAny -TimeToLive 01:00:00 -AgeRecord -PtrDomainName "hostname123.contoso.com"
As we develop our competence with powershell, we would like to make it so we can use (get-content) to import DNS entries from a .csv file then as much as possible automate the creation of DNS 'A' and 'PTR' records. How can we do this?
Thank you for your insight and ideas!
Cheers!