String dnsServerName = "localhost"; ManagementScope scope = new ManagementScope(@"\\" + dnsServerName + "\\root\\MicrosoftDNS"); scope.Connect(); ManagementClass cmiClass = new ManagementClass(scope, new ManagementPath("MicrosoftDNS_AType"), null); ManagementBaseObject inParams = wmiClass.GetMethodParameters("CreateInstanceFromPropertyData"); inParams["DnsServerName"] = this.ServerName; inParams["ContainerName"] = zone; inParams["OwnerName"] = hostName + "." + zone; inParams["IPAddress"] = iPAddress; cmiClass.InvokeMethod("CreateInstanceFromPropertyData", inParams, null);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)