itbox
asked on
Creating a Secondary DNS Zone via WMI and C#
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.
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);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did it Chris, thanks.
http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en