Archived from groups: microsoft.public.win2000.dns (
More info?)
dnscmd does not seem to have any facility for this. Very strange. Very
strange indeed. I'm going to post this to the other side and see what people
have to say about it.
--
Sincerely,
Dèjì Akómöláfé, MCSE MCSA MCP+I
Microsoft MVP - Directory Services
www.readymaids.com - COMPLETE SPAM Protection
www.akomolafe.com
Do you now realize that Today is the Tomorrow you were worried about
Yesterday? -anon
"Deji Akomolafe" <deji@REMOVEPADDINGakomolafedotcom> wrote in message
news:OHnwpRtZEHA.3112@TK2MSFTNGP09.phx.gbl...
> You know, that's interesting. I want to say dnscmd can't do that, but I'd
be
> lying if I say "I am sure" of that statement. I'd spend some time with
> dnscmd and see if I can come up with a categorical statement.
>
> --
> Sincerely,
>
> Dèjì Akómöláfé, MCSE MCSA MCP+I
> Microsoft MVP - Directory Services
> www.readymaids.com - COMPLETE SPAM Protection
> www.akomolafe.com
> Do you now realize that Today is the Tomorrow you were worried about
> Yesterday? -anon
>
>
> "Ace Fekay [MVP]"
> <PleaseSubstituteMyActualFirstName&LastNameHere@hotmail.com> wrote in
> message news:OFNPXXoZEHA.1980@TK2MSFTNGP09.phx.gbl...
> > In news:uoR7wQfZEHA.1248@TK2MSFTNGP11.phx.gbl,
> > William Stacey [MVP] <staceywREMOVE@mvps.org> asked for help and I
offered
> > my suggestions below:
> > > 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()
> > >
> > >
> > > "m8v316" <m8v316@discussions.microsoft.com> wrote in message
> > > news:5D79FA85-7425-4E89-92E3-4C08B81CD71A@microsoft.com...
> > >> Is it possible to delete a zone or record using WMI?
> > >>
> > >> TechNet has a quite a few easy to understand examples for creating
> > >> and
> > > enumerating zones and records at:
> > >>
> > >>
> > >
> >
>
http://www.microsoft.com/technet/community/scriptcenter/network/default.mspx
> > >>
> > >> But there is no examples to delete zones or records. Does anyone
> > >> know how
> > > its done and, better yet, have a simple example?
> > >>
> > >> Thanks.
> >
> > William and Deji, there was a question asked last week (have to find the
> > post) on how to create a child zone of an existing zone with DNSCMD.
> > Apparently from what the poster said, DNSCMD will just create a full
FQDN
> of
> > the child and parent zone and not make it a child of the parent.
> >
> > eg. dnscmd will create:
> > child1.domain.com
> > child2.domain.com
> > etc
> >
> > instead of rather the expected (or desired):
> > domain.com
> > child1
> > child2
> > etc.
> >
> > Not sure if you guys saw the post, but if you didn't, appreciate any
> > comments on it. I didn't respond since I wasn't sure how to get around
> that.
> >
> > --
> > Regards,
> > Ace
> >
> > Please direct all replies ONLY to the Microsoft public newsgroups
> > so all can benefit.
> >
> > This posting is provided "AS-IS" with no warranties or guarantees
> > and confers no rights.
> >
> > Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
> > Microsoft Windows MVP - Active Directory
> >
> > HAM AND EGGS: A day's work for a chicken;
> > A lifetime commitment for a pig.
> > --
> > =================================
> >
> >
>
>