我正在尝试将 CNAME 记录添加到 Windows 2k8 上的 MS DNS 服务器,但在 ASP.NET 中运行此代码但在桌面应用程序中运行时出现“通用故障”:
ManagementScope _session = null;
_session = new ManagementScope("\\\\.\\root\\MicrosoftDNS");
_session.Connect();
ManagementClass zoneObj = new ManagementClass(_session, new ManagementPath("MicrosoftDNS_CNAMEType"),null);
ManagementBaseObject inParams = zoneObj.GetMethodParameters("CreateInstanceFromPropertyData");
inParams["DnsServerName"] = "xxx.com";
inParams["ContainerName"] = "xxx.com";
inParams["OwnerName"] = "test.xxx.com";
inParams["PrimaryName"] = "en.xxx.com";
zoneObj.InvokeMethod("CreateInstanceFromTextRepresentation", inParams, null);
似乎问题回到了用户权限,我怎样才能将 **_IUSER 或 ASPNET 发送到 MicrosoftDNS 或其他任何东西来解决这个问题?