Solved

Creating a Secondary DNS Zone via WMI and C#

Posted on 2009-06-30
3
935 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
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 70

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
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 …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now