private void BindPermissions() { try { ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxPermissions(PanelRequest.ItemID, PanelRequest.AccountID); litDisplayName.Text = mailbox.DisplayName; sendAsPermission.SetAccounts(mailbox.SendAsAccounts); fullAccessPermission.SetAccounts(mailbox.FullAccessAccounts); // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); if (account.AccountType == ExchangeAccountType.SharedMailbox) { litDisplayName.Text += GetSharedLocalizedString("SharedMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Room) { litDisplayName.Text += GetSharedLocalizedString("RoomMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Equipment) { litDisplayName.Text += GetSharedLocalizedString("EquipmentMailbox.Text"); } } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_PERMISSIONS", ex); } }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxMailFlowSettings( PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; // bind form chkEnabledForwarding.Checked = mailbox.EnableForwarding; forwardingAddress.SetAccount(mailbox.ForwardingAccount); chkDoNotDeleteOnForward.Checked = mailbox.DoNotDeleteOnForward; accessAccounts.SetAccounts(mailbox.SendOnBehalfAccounts); acceptAccounts.SetAccounts(mailbox.AcceptAccounts); chkSendersAuthenticated.Checked = mailbox.RequireSenderAuthentication; rejectAccounts.SetAccounts(mailbox.RejectAccounts); // toggle ToggleControls(); // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.MailFlowSettings) > 0; } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_MAILFLOW", ex); } }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); ExchangeMailboxAutoReplySettings autoReply = ES.Services.ExchangeServer.GetMailboxAutoReplySettings(PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; // auto reply settings rblSetAutoreply.SelectedIndex = (autoReply.AutoReplyState != OofState.Disabled) ? 1 : 0; chkAutoReplyTime.Checked = autoReply.AutoReplyState == OofState.Scheduled; chkOutsideOrganization.Checked = autoReply.ExternalAudience != ExternalAudience.None; txtIntReply.Text = autoReply.InternalMessage; txtExtReply.Text = autoReply.ExternalMessage; txtStartTime.Text = autoReply.StartTime.ToString("HH:mm"); txtStartDate.Text = autoReply.StartTime.ToString("yyyy-MM-dd"); txtEndTime.Text = autoReply.EndTime.ToString("HH:mm"); txtEndDate.Text = autoReply.EndTime.ToString("yyyy-MM-dd"); rblExternalAudience.SelectedIndex = (autoReply.ExternalAudience == ExternalAudience.Known) ? 0 : 1; } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_AUTOREPLY_SETTINGS", ex); } ToggleControls(); }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); //get statistics ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; // bind form chkHideAddressBook.Checked = mailbox.HideFromAddressBook; chkDisable.Checked = mailbox.Disabled; lblExchangeGuid.Text = string.IsNullOrEmpty(mailbox.ExchangeGuid) ? "<>" : mailbox.ExchangeGuid; // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); // get mailbox plan ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, account.MailboxPlanId); ExchangeJournalRule rule = ES.Services.ExchangeServer.GetJournalRule(PanelRequest.ItemID, account.PrimaryEmailAddress); cbEnabled.Checked = rule.Enabled; ddlScope.SelectedValue = rule.Scope; ddlRecipient.SelectedValue = rule.Recipient; if (account.MailboxPlanId == 0) { mailboxPlanSelector.AddNone = true; mailboxPlanSelector.MailboxPlanId = "-1"; } else { mailboxPlanSelector.MailboxPlanId = account.MailboxPlanId.ToString(); } mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024); mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1 : (int)Math.Round((double)(stats.MaxSize / 1024 / 1024)); if (account.LevelId > 0 && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) { EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(account.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; } imgVipUser.Visible = account.IsVIP && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_JOURNALING_MAILBOX_SETTINGS", ex); } }
/// <summary> /// Creates mailbox /// </summary> private bool CreateMailbox(int index, int orgId, string displayName, string emailAddress, string password, string firstName, string middleName, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes) { bool ret = false; try { string name = emailAddress.Substring(0, emailAddress.IndexOf("@")); string domain = emailAddress.Substring(emailAddress.IndexOf("@") + 1); //create mailbox //ES.Services.ExchangeServer. string accountName = string.Empty; int accountId = ES.Services.ExchangeServer.CreateMailbox(orgId, 0, ExchangeAccountType.Mailbox, accountName, displayName, name, domain, password, false, string.Empty); if (accountId < 0) { string errorMessage = GetErrorMessage(accountId); Log.WriteError(string.Format("Error at line {0}: {1}", index + 1, errorMessage)); return(false); } ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(orgId, accountId); mailbox.FirstName = firstName; mailbox.Initials = middleName; mailbox.LastName = lastName; mailbox.Address = address; mailbox.City = city; mailbox.State = state; mailbox.Zip = zip; mailbox.Country = country; mailbox.JobTitle = jobTitle; mailbox.Company = company; mailbox.Department = department; mailbox.Office = office; mailbox.BusinessPhone = businessPhone; mailbox.Fax = fax; mailbox.HomePhone = homePhone; mailbox.MobilePhone = mobilePhone; mailbox.Pager = pager; mailbox.WebPage = webPage; mailbox.Notes = notes; //update mailbox ES.Services.ExchangeServer.SetMailboxGeneralSettings(orgId, accountId, mailbox.DisplayName, null, mailbox.HideFromAddressBook, mailbox.Disabled, mailbox.FirstName, mailbox.Initials, mailbox.LastName, mailbox.Address, mailbox.City, mailbox.State, mailbox.Zip, mailbox.Country, mailbox.JobTitle, mailbox.Company, mailbox.Department, mailbox.Office, null, mailbox.BusinessPhone, mailbox.Fax, mailbox.HomePhone, mailbox.MobilePhone, mailbox.Pager, mailbox.WebPage, mailbox.Notes); ret = true; } catch (Exception ex) { Log.WriteError(string.Format("Error at line {0}: Unable to create mailbox", index + 1), ex); } return(ret); }
private string GetMailflowImage() { string result = string.Empty; ExchangeMailbox mailboxMailFlowSettings = ES.Services.ExchangeServer.GetMailboxMailFlowSettings(ItemId, AccountId); if (mailboxMailFlowSettings != null && mailboxMailFlowSettings.EnableForwarding) { result = "<span class=\"fa fa-arrow-circle-o-right fa-lg text-success\" ></span>"; } return(result); }
private string GetLitigationImage() { string result = string.Empty; ExchangeMailbox mailboxGeneralSettings = ES.Services.ExchangeServer.GetMailboxGeneralSettings(ItemId, AccountId); if (mailboxGeneralSettings != null && mailboxGeneralSettings.EnableLitigationHold) { result = "<span class=\"fa fa-gavel fa-lg text-danger\" ></span>"; } return(result); }
private void BindSettings() { try { password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); password.EditMode = true; // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; // bind form txtDisplayName.Text = mailbox.DisplayName; chkHideAddressBook.Checked = mailbox.HideFromAddressBook; chkDisable.Checked = mailbox.Disabled; txtFirstName.Text = mailbox.FirstName; txtInitials.Text = mailbox.Initials; txtLastName.Text = mailbox.LastName; txtJobTitle.Text = mailbox.JobTitle; txtCompany.Text = mailbox.Company; txtDepartment.Text = mailbox.Department; txtOffice.Text = mailbox.Office; manager.SetAccount(mailbox.ManagerAccount); txtBusinessPhone.Text = mailbox.BusinessPhone; txtFax.Text = mailbox.Fax; txtHomePhone.Text = mailbox.HomePhone; txtMobilePhone.Text = mailbox.MobilePhone; txtPager.Text = mailbox.Pager; txtWebPage.Text = mailbox.WebPage; txtAddress.Text = mailbox.Address; txtCity.Text = mailbox.City; txtState.Text = mailbox.State; txtZip.Text = mailbox.Zip; country.Country = mailbox.Country; txtNotes.Text = mailbox.Notes; // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.GeneralSettings) > 0; } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); } }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxAdvancedSettings( PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; // load space context PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); chkPOP3.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_POP3ALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaExhausted; chkIMAP.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_IMAPALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaExhausted; chkOWA.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_OWAALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaExhausted; chkMAPI.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_MAPIALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaExhausted; chkActiveSync.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaExhausted; // bind form chkPOP3.Checked = mailbox.EnablePOP; chkIMAP.Checked = mailbox.EnableIMAP; chkOWA.Checked = mailbox.EnableOWA; chkMAPI.Checked = mailbox.EnableMAPI; chkActiveSync.Checked = mailbox.EnableActiveSync; lblTotalItems.Text = mailbox.TotalItems.ToString(); lblTotalSize.Text = mailbox.TotalSizeMB.ToString(); lblLastLogon.Text = Utils.FormatDateTime(mailbox.LastLogon); lblLastLogoff.Text = Utils.FormatDateTime(mailbox.LastLogoff); sizeIssueWarning.ValueKB = mailbox.IssueWarningKB; sizeProhibitSend.ValueKB = mailbox.ProhibitSendKB; sizeProhibitSendReceive.ValueKB = mailbox.ProhibitSendReceiveKB; daysKeepDeletedItems.ValueDays = mailbox.KeepDeletedItemsDays; txtAccountName.Text = mailbox.Domain + "\\" + mailbox.AccountName; // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.AdvancedSettings) > 0; } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_ADVANCED", ex); } }
public ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName) { try { LogStart("GetMailboxPermissions"); ExchangeMailbox ret = ES.GetMailboxPermissions(organizationId, accountName); LogEnd("GetMailboxPermissions"); return(ret); } catch (Exception ex) { LogError("GetMailboxPermissions", ex); throw; } }
public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) { try { LogStart("GetMailboxAdvancedSettings"); ExchangeMailbox ret = ES.GetMailboxAdvancedSettings(accountName); LogEnd("GetMailboxAdvancedSettings"); return(ret); } catch (Exception ex) { LogError("GetMailboxAdvancedSettings", ex); throw; } }
private void BindPermissions() { try { ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxPermissions(PanelRequest.ItemID, PanelRequest.AccountID); litDisplayName.Text = mailbox.DisplayName; sendAsPermission.SetAccounts(mailbox.SendAsAccounts); fullAccessPermission.SetAccounts(mailbox.FullAccessAccounts); } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_PERMISSIONS", ex); } }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); // title litDisplayName.Text = mailbox.DisplayName; List <ExchangeAccount> groupsList = new List <ExchangeAccount>(); //Distribution Lists ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); foreach (ExchangeAccount distList in dLists) { groupsList.Add(distList); } if (EnableSecurityGroups) { //Security Groups ExchangeAccount[] securGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); foreach (ExchangeAccount secGroup in securGroups) { groupsList.Add(secGroup); } } groups.SetAccounts(groupsList.ToArray()); } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); } }
private void BindSettings() { try { // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); //get statistics ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID, PanelRequest.AccountID); // mailbox plan // title litDisplayName.Text = mailbox.DisplayName; // bind form chkHideAddressBook.Checked = mailbox.HideFromAddressBook; chkDisable.Checked = mailbox.Disabled; lblExchangeGuid.Text = string.IsNullOrEmpty(mailbox.ExchangeGuid) ? "<>" : mailbox.ExchangeGuid; // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); // get mailbox plan ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, account.MailboxPlanId); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.GeneralSettings) > 0; if (account.MailboxPlanId == 0) { mailboxPlanSelector.AddNone = true; mailboxPlanSelector.MailboxPlanId = "-1"; } else { mailboxPlanSelector.MailboxPlanId = account.MailboxPlanId.ToString(); } if (account.ArchivingMailboxPlanId < 1) { mailboxRetentionPolicySelector.MailboxPlanId = "-1"; } else { mailboxRetentionPolicySelector.MailboxPlanId = account.ArchivingMailboxPlanId.ToString(); } mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024); mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1 : (int)Math.Round((double)(stats.MaxSize / 1024 / 1024)); secCalendarSettings.Visible = ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room)); secLitigationHoldSettings.Visible = mailbox.EnableLitigationHold; litigationHoldSpace.QuotaUsedValue = Convert.ToInt32(stats.LitigationHoldTotalSize / 1024 / 1024); litigationHoldSpace.QuotaValue = (stats.LitigationHoldMaxSize == -1) ? -1 : (int)Math.Round((double)(stats.LitigationHoldMaxSize / 1024 / 1024)); if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISCLAIMERSALLOWED, Cntx)) { int disclaimerId = ES.Services.ExchangeServer.GetExchangeAccountDisclaimerId(PanelRequest.ItemID, PanelRequest.AccountID); ddDisclaimer.SelectedValue = disclaimerId.ToString(); } int ArchivingMaxSize = -1; if (plan != null) { ArchivingMaxSize = plan.ArchiveSizeMB; } chkEnableArchiving.Checked = account.EnableArchiving; archivingQuotaViewer.QuotaUsedValue = Convert.ToInt32(stats.ArchivingTotalSize / 1024 / 1024); archivingQuotaViewer.QuotaValue = ArchivingMaxSize; rowArchiving.Visible = chkEnableArchiving.Checked; if (account.LevelId > 0 && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) { WebsitePanel.EnterpriseServer.Base.HostedSolution.ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(account.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; } imgVipUser.Visible = account.IsVIP && Cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); if (account.AccountType == ExchangeAccountType.SharedMailbox) { litDisplayName.Text += GetSharedLocalizedString("SharedMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Room) { litDisplayName.Text += GetSharedLocalizedString("RoomMailbox.Text"); } if (account.AccountType == ExchangeAccountType.Equipment) { litDisplayName.Text += GetSharedLocalizedString("EquipmentMailbox.Text"); } } catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); } }