Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating a Secondary DNS Zone via WMI and C#

Posted on 2009-06-30
3
Medium Priority
?
970 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 71

Accepted Solution

by:
Chris Dent earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Learn about cloud computing and its benefits for small business owners.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

782 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