我想以编程方式在 Windows Server 上创建的域上设置主 ns 服务器:
ManagementBaseObject outParams = zoneObj.InvokeMethod("CreateZone", inParams, null);ManagementClass zoneObj = new ManagementClass(session, new ManagementPath("MicrosoftDNS_Zone"), null);
ManagementBaseObject inParams = zoneObj.GetMethodParameters("CreateZone");
inParams["ZoneName"] = "mydomain.com";
inParams["ZoneType"] = 0;
inParams["DNSServer"] = "ns1.myserver.com"; //--- I am getting an error here!
ManagementBaseObject outParams = zoneObj.InvokeMethod("CreateZone", inParams, null);
我无法设置这个,但我尝试过:dnsserver,nsserver,dnsname,
一切都无法工作。