Script to Delete DHCP lease entries (Blank, BAD_ADDRESS, ...)

My Class C netmask is running out of addresses because of lots of blank entries and some BAD_ADDRESS entries. It is not convenient to change the netmask at this time and I’ve shortened the expiration to half a day already. I would like to be able on demand, or perhaps scheduled daily to delete transient wifi users and other leases that can be cleared when DHCP runs out of addresses.

I believe the Powershell Command Remove-DhcpServerv4Lease will accomplish what I want, but I am not familiar with Powershell. Can someone provide a script that will look for DHCP lease entries and conditionally delete them.
e.g. Delete DHCP lease if Name is blank, Name is BAD_ADDRESS, {other names to be added later}, …

Thanks 1,000,000!

Welcome to the forum. :wave:t4:

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.