protected void Page_Load(object sender, EventArgs e) { hMailServerNetRemote.IClassFactory cf = RemoteActivation.GetRemoteClassFactory("http://216.167.175.124/hMailServerWebAdmin/"); hMailServerNetRemote.IApplication application; if (Session["hMailServerNetRemoteApplication"] == null) { application = cf.CreateApplication(); Session["hMailServerNetRemoteApplication"] = application; } else { application = (hMailServerNetRemote.Application)Session["hMailServerNetRemoteApplication"]; } // the rest is the same application.Authenticate("Administrator", "testar"); // You can do it like VB, but let's do it the C# way. :) // hMailServerNetRemote.Domain domain = application.Domains.ItemByName("example.com"); hMailServerNetRemote.IDomain domain = application.Domains["example.com"]; hMailServerNetRemote.IAccount account = domain.Accounts.ItemByAddress("*****@*****.**"); account.Password = "******"; account.Save(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } hMailServerNetRemote.IDomain dom = app.Domains.ItemByDBID(Convert.ToInt32(Request.QueryString["ID"])); DomainName.Text = dom.Name; List <hMailServerNetRemote.IDistributionList> dls = new List <hMailServerNetRemote.IDistributionList>(); hMailServerNetRemote.IDistributionLists d = dom.DistributionLists; int c = d.Count; for (int i = 0; i < c; i++) { dls.Add(d[i]); } DistributionList.DataSource = dls; DistributionList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } hMailServerNetRemote.IDomain dom = app.Domains.ItemByDBID(Convert.ToInt32(Request.QueryString["ID"])); if (!IsPostBack) { DomainName.Text = dom.Name; Enabled.Checked = dom.Active; AccountLink.NavigateUrl = "~/Admin/Accounts.aspx?ID=" + Request.QueryString["ID"]; Aliases.NavigateUrl = "~/Admin/DomainAliases.aspx?ID=" + Request.QueryString["ID"]; DistributionLists.NavigateUrl = "~/Admin/DistributionLists.aspx?ID=" + Request.QueryString["ID"]; } else { dom.Name = DomainName.Text; dom.Active = Enabled.Checked; dom.Save(); } }
protected void Page_Load(object sender, EventArgs e) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } Version.Text = app.Version; }
public IHttpActionResult EnableWinRM([FromBody] PSConnection options) { try { RemoteActivation.ConfigureWinRM(options.ComputerName, options.UserName, options.Password); return(Ok()); } catch (Exception ex) { throw new HttpResponseException(Request.CreateErrorResponse(System.Net.HttpStatusCode.BadRequest, new HttpError(ex.Message))); } }
protected void Page_Load(object sender, EventArgs e) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } string[] sp = Request.QueryString["Address"].Split(new Char[] { '@' }); if (sp.Length != 2) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDomain domain = app.Domains.ItemByName(sp[1]); if (domain == null) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDistributionList ds = domain.DistributionLists.ItemByAddress(Request.QueryString["Address"]); if (ds == null) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDistributionListRecipients re = ds.Recipients; if (!IsPostBack) { DistributionListName.Text = ds.Address; List <hMailServerNetRemote.IDistributionListRecipient> addys = new List <hMailServerNetRemote.IDistributionListRecipient>(); int c = re.Count; for (int i = 0; i < c; i++) { addys.Add(re[i]); } AddressList.DataSource = addys; AddressList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } List <hMailServerNetRemote.IDomain> domains = new List <hMailServerNetRemote.IDomain>(); int c = app.Domains.Count; hMailServerNetRemote.IDomains ds = app.Domains; for (int i = 0; i < c; i++) { domains.Add(ds[i]); } DomainList.DataSource = domains; DomainList.DataBind(); } }