Sure. Here is DeleteZone and DeleteRR I did in c# awhile ago. HTH
public void DeleteZone(string zoneName)
{
//This method Deletes the zone named in zoneName.
//Step 1 - Check input parms:
if ( zoneName == null )
throw new ArgumentNullException("zoneName", "zoneName is null.");
try
{
ObjectQuery oQuery = new System.Management.ObjectQuery("Select *
from MicrosoftDNS_Zone Where ContainerName = '" + zoneName + "'");
ManagementObjectSearcher oSearcher = new
ManagementObjectSearcher(ms, oQuery);
ManagementObjectCollection zoneCollection = oSearcher.Get();
bool zoneFound = false;
foreach ( ManagementObject zone in zoneCollection )
{
zoneFound = true;
zone.Delete();
break; //Only one zone could match, so break.
}
if ( ! zoneFound )
throw new ZoneNotFoundException();
}
catch(System.Management.ManagementException e)
{
throw new ApplicationException(e.ErrorCode.ToString() + ". " +
e.Message); }
catch(MVPTools.DnsManagement.ZoneNotFoundException)
{
throw new ZoneNotFoundException("Zone not found.");
}
catch(Exception e)
{
throw new ApplicationException(e.Message);
}
} // End DeleteZone()
public void DeleteRR(string zoneName, string ownerName, string rData)
{
//Step 1 - Check input parms:
if ( zoneName == null )
throw new ArgumentNullException("zoneName", "zoneName is null.");
if ( ownerName == null )
throw new ArgumentNullException("ownerName", "ownerName is null.");
if ( rData == null )
throw new ArgumentNullException("rData", "rData is null.");
//Step 2 - Check for and Get RR object if it exists.
try
{
ManagementObject rr = null;
if ( ! RRExists(zoneName, ownerName, rData, out rr) )
throw new MVPTools.DnsManagement.RRNotFoundException();
if ( rr == null )
throw new RRNotFoundException();
rr.Delete();
}
catch(System.Management.ManagementException e)
{
throw new ApplicationException(e.ErrorCode.ToString() + ". " +
e.Message); }
catch(MVPTools.DnsManagement.RRNotFoundException)
{
throw new RRNotFoundException("RR not found.");
}
catch(Exception e)
{
throw new ApplicationException(e.Message);
}
} // End DeleteRR()
enumerating zones and records at:
http://www.microsoft.com/technet/community/scriptcenter/network/default.mspx
its done and, better yet, have a simple example?