Solved

Creating a Secondary DNS Zone via WMI and C#

Posted on 2009-06-30
3
950 Views
Last Modified: 2012-05-07
Hello everyone,
  What I am trying to do is create a secondary DNS Zone on my Secondary Name Server but I am a bit confused. I have a bit of code that will create Zones no problem (below).  The problem I am having is I am not seeing how to create a Secondary Zone and point it at the primary Name server.

I have taken a look at http://msdn.microsoft.com/en-us/library/ms682757(VS.85).aspx but there doesn't appear to be a property that is available that will allow me to do this? Any help would be greatly appreciated.

ManagementObject mc = new ManagementClass(_scope, new ManagementPath("MicrosoftDNS_Zone"), null);
                mc.Get();
                ManagementBaseObject params = mc.GetMethodParameters("CreateZone");
 
                params["ZoneName"] = zoneName;
                params["ZoneType"] = (UInt32)zoneType;
                params["DsIntegrated"] = 0; //false
                ManagementBaseObject zone = mc.InvokeMethod("CreateZone", params, null);

Open in new window

0
Comment
Question by:itbox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Expert Comment

by:loftyworm
ID: 24750552
The property may not exist.  I use WMI Code Creator to find the properties and values that are available, and for simple queries.

http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 24752949

It does exist. It's this one:

> [in, optional]  string IpAddr[],

Noted here:

http://msdn.microsoft.com/en-us/library/ms682760(VS.85).aspx

And should be a string array.

Chris
0
 

Author Closing Comment

by:itbox
ID: 31598523
That did it Chris, thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question