I have a custom C# windows forms app that adds new domains to IIS 7 and also adds postoffices and mailboxes to MailEnable. But for some reason the following code always fails (and returns false) for both the AddWebmailSite() and AddWebAdminSite() methods:
Code: Select all
private void AddWebmailToWebsite(long IIS7WebSiteID)
{
MailEnable.Administration.Web.IISManagement iisManagement = new MailEnable.Administration.Web.IISManagement();
if (false == iisManagement.AddWebmailSite(IIS7WebSiteID.ToString()))
{
MessageBox.Show("AddWebmailSite(" + IIS7WebSiteID.ToString() + ") Error");
}
if (false == iisManagement.AddWebAdminSite(IIS7WebSiteID.ToString()))
{
MessageBox.Show("AddWebAdminSite(" + IIS7WebSiteID.ToString() + ") Error");
}
}
Any idea why these two methods fail?