I want to access to System.Management and add dns record. Current code works fine on windows application, but I looking for a permission to run the code on web application too.
string site = "domain.com";
ConnectionOptions co = new ConnectionOptions();
ManagementScope _scope = new ManagementScope(String.Format(@"\\{0}\Root\MicrosoftDNS", "host name"), co);
_scope.Connect();
ManagementObject mc = new ManagementClass(_scope, new ManagementPath("MicrosoftDNS_Zone"), null);
mc.Get();
ManagementBaseObject parameters = mc.GetMethodParameters("CreateZone");
parameters["ZoneName"] = site;
parameters["ZoneType"] = (UInt32)DNSServer.NewZoneType.Primary;
parameters["DsIntegrated"] = 0; //false
ManagementBaseObject createdEntry = mc.InvokeMethod("CreateZone", parameters, null);
I need the permission for web application, and here is what I did up to know:
Windows Authentication:
<security>
<authentication>
<anonymousAuthentication enabled="false"/>
<windowsAuthentication enabled="true"/>
</authentication>
</security>
Permission entire:
iis feature delegation:
Update: you could to see the bug here on this link