Hi @joaomanoelc ,
please try this (the -force
needs to be inside the {}
):
Get-Content -path c:\temp\ListHost.txt | ForEach {Remove-DnsServerResourceRecord -ZoneName "contoso.com" -RRType "A" -Name "$" -Force}
To remove the PTR record the -RRType
needs to be Ptr
.
Maybe this helps:
https://rcmtech.wordpress.com/2014/02/26/get-and-delete-dns-a-and-ptr-records-via-powershell/
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten