Use the Set-DnsServerResourceRecord cmdlet and remove the expiration timestamp from the resource records.
How to check or uncheck boxes to delete stale Record DNS
Hello,
In order to control the DNS Scavenging, I would like to enable the feature in my DNSZone on a group of devices (approximately 1000 records).
Please my question is how to uncheck the box "Delete this record when it becomes stale" (see attachement) on all of my record by using powershell or how to let this box checked only on targeted devices identyfied in csv or txt file.
Thnak you by advance
Mohamed
3 answers
Sort by: Most helpful
-
-
Limitless Technology 39,661 Reputation points
2022-02-18T14:34:29.783+00:00 Hello @Mohamed SAKHO
You can use the next command:
dnscmd /Config domain.com hostname /ScavengingInterval 0
(zero will disable)
Reference and examples: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771570(v=ws.11)?redirectedfrom=MSDN
Hope this helps with your query,
-------
--If the reply is helpful, please Upvote and Accept as answer-- -
Mohamed SAKHO 116 Reputation points
2022-02-24T17:04:29.057+00:00 Hello @Limitless Technology ,
Thank you for your answer, but your command doesn't works when I try to launch it.
We can't put a host name after ce dns zone name. This command works only on the dns zone and not for a record.
On the article you posted it is not indicate that it runs for a record.