ManagementException:Generic Failure when try to create DNS Zone

  • Thread starter Thread starter Caner Ünver
  • Start date Start date
C

Caner Ünver

Guest
I'm developing a project for creating DNS Zone programmatically

My project is running under a server as a local website.Server has windows 2008 R2 SP1 operating system.

I gave all needed autherization to wmi control namespaces.

Here is my method for Creating DNS Zone

public void CreateZone(string zoneIsmi)
{


ManagementClass KayitSinif = new ManagementClass("\\\\appserver\\root\\MicrosoftDNS", "MicrosoftDNS_Zone", null);

ManagementBaseObject Parametreler = KayitSinif.GetMethodParameters("CreateZone");

Parametreler["ZoneName"] = zoneIsmi;

Parametreler["ZoneType"] = 0;


ManagementBaseObject OutParams = KayitSinif.InvokeMethod("CreateZone", Parametreler, null);

}


In the Error's stackTrace,it seems like problem is about InvokeMethod. Here is the stack trace

[ManagementException: Generic failure ]

System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) +136 System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options) +423 WebsiteOlusturmaUygulama.Olustur.CreateZone(String zoneIsmi) in C:\Projeler\OrionWebsiteManager\WebsiteOlusturmaUygulama\Olustur.aspx.cs:301 WebsiteOlusturmaUygulama.Olustur.Button1_Click(Object sender, EventArgs e) in C:\Projeler\OrionWebsiteManager\WebsiteOlusturmaUygulama\Olustur.aspx.cs:38 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +109 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +31 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3455



I'm trying to create forwarder zone.

I couldnt understand why my method is not working.I searched for couple of days but i couldnt find any solution.

I'll be pleasure for all replies and helpes,and by the way sorry for my bad english.

Continue reading...
 
Back
Top