You have to import the module DnsServer first
Import-Module DnsServer
And that requires the server has the DnsServer role, see
https://learn.microsoft.com/en-us/powershell/module/dnsserver/?view=windowsserver2022-ps
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using the below PowerShell command to remove the DNS record but facing error not recognized in the cmdlet tried to install dnsserver module but couldn't able to resolve the error
Command used:
Remove-DnsServerResourceRecord -ZoneName "contoso.com" -RRType "A" -Name "Host01" -RecordData "10.17.1.41"
Error :
You have to import the module DnsServer first
Import-Module DnsServer
And that requires the server has the DnsServer role, see
https://learn.microsoft.com/en-us/powershell/module/dnsserver/?view=windowsserver2022-ps