private void BindSettings()
        {
            try
            {
                // get settings
                ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListGeneralSettings(
                    PanelRequest.ItemID, PanelRequest.AccountID);

                litDisplayName.Text = PortalAntiXSS.Encode(dlist.DisplayName);

                ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID);

                List <ExchangeAccount> groupsList = new List <ExchangeAccount>();
                foreach (ExchangeAccount distList in dLists)
                {
                    groupsList.Add(distList);
                }

                if (EnableSecurityGroups)
                {
                    ExchangeAccount[] secGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID);

                    foreach (ExchangeAccount secGroup in secGroups)
                    {
                        groupsList.Add(secGroup);
                    }
                }

                groups.SetAccounts(groupsList.ToArray());
            }
            catch (Exception ex)
            {
                messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex);
            }
        }
示例#2
0
        private void BindSettings()
        {
            try
            {
                // get settings
                ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListGeneralSettings(
                    PanelRequest.ItemID, PanelRequest.AccountID);

                litDisplayName.Text = dlist.DisplayName;

                // bind form
                txtDisplayName.Text        = dlist.DisplayName;
                chkHideAddressBook.Checked = dlist.HideFromAddressBook;

                manager.SetAccount(dlist.ManagerAccount);

                members.SetAccounts(dlist.MembersAccounts);

                txtNotes.Text = dlist.Notes;
            }
            catch (Exception ex)
            {
                messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex);
            }
        }
 public static void Run()
 {
     // ExStart:DeleteWithoutListing
     IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
     ExchangeDistributionList distributionList = new ExchangeDistributionList();
     distributionList.Id = "list's id";
     client.DeleteDistributionList(distributionList,true);
     // ExEnd:DeleteWithoutListing
 }
示例#4
0
        public static void Run()
        {
            // ExStart:DeleteWithoutListing
            IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
            ExchangeDistributionList distributionList = new ExchangeDistributionList();

            distributionList.Id = "list's id";
            client.DeleteDistributionList(distributionList, true);
            // ExEnd:DeleteWithoutListing
        }
 public static void Run()
 {
     // ExStart:AddMembersWithoutListing
     IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
     ExchangeDistributionList distributionList = new ExchangeDistributionList();
     distributionList.Id = "list's id";
     distributionList.ChangeKey = "list's change key";
     MailAddressCollection newMembers = new MailAddressCollection();
     newMembers.Add("*****@*****.**");
     client.AddToDistributionList(distributionList, newMembers);
     // ExEnd:AddMembersWithoutListing
 }
 public static void Run()
 {
     // ExStart:CreatePrivateDistributionList
     IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
     ExchangeDistributionList distributionList = new ExchangeDistributionList();
     distributionList.DisplayName = "test private list";
     MailAddressCollection members = new MailAddressCollection();
     members.Add("*****@*****.**");
     members.Add("*****@*****.**");
     members.Add("*****@*****.**");
     client.CreateDistributionList(distributionList, members);
     // ExEnd:CreatePrivateDistributionList
 }       
示例#7
0
        public static void Run()
        {
            // ExStart:AddMembersWithoutListing
            IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
            ExchangeDistributionList distributionList = new ExchangeDistributionList();

            distributionList.Id        = "list's id";
            distributionList.ChangeKey = "list's change key";
            MailAddressCollection newMembers = new MailAddressCollection();

            newMembers.Add("*****@*****.**");
            client.AddToDistributionList(distributionList, newMembers);
            // ExEnd:AddMembersWithoutListing
        }
 public static void Run()
 {
     // ExStart:DeleteMembersWithoutListing
     IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
     ExchangeDistributionList distributionList = new ExchangeDistributionList();
     distributionList.Id = "list's id";
     distributionList.ChangeKey = "list's change key";
     MailAddressCollection membersToDelete = new MailAddressCollection();
     MailAddress addressToDelete = new MailAddress("address", true);
     //addressToDelete.Id.EWSId = "member's id";
     membersToDelete.Add(addressToDelete);
     client.AddToDistributionList(distributionList, membersToDelete);
     // ExEnd:DeleteMembersWithoutListing
 }
 public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName)
 {
     try
     {
         LogStart("GetDistributionListMailFlowSettings");
         ExchangeDistributionList ret = ES.GetDistributionListMailFlowSettings(accountName);
         LogEnd("GetDistributionListMailFlowSettings");
         return(ret);
     }
     catch (Exception ex)
     {
         LogError("GetDistributionListMailFlowSettings", ex);
         throw;
     }
 }
        public static void Run()
        {
            // ExStart:CreatePrivateDistributionList
            IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
            ExchangeDistributionList distributionList = new ExchangeDistributionList();

            distributionList.DisplayName = "test private list";
            MailAddressCollection members = new MailAddressCollection();

            members.Add("*****@*****.**");
            members.Add("*****@*****.**");
            members.Add("*****@*****.**");
            client.CreateDistributionList(distributionList, members);
            // ExEnd:CreatePrivateDistributionList
        }
        public static void Run()
        {
            // ExStart:DeleteMembersWithoutListing
            IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
            ExchangeDistributionList distributionList = new ExchangeDistributionList();

            distributionList.Id        = "list's id";
            distributionList.ChangeKey = "list's change key";
            MailAddressCollection membersToDelete = new MailAddressCollection();
            MailAddress           addressToDelete = new MailAddress("address", true);

            //addressToDelete.Id.EWSId = "member's id";
            membersToDelete.Add(addressToDelete);
            client.AddToDistributionList(distributionList, membersToDelete);
            // ExEnd:DeleteMembersWithoutListing
        }
示例#12
0
        public static void Update(this ContactItem thisContactItem, ExchangeDistributionList distributionList)
        {
            var user = distributionList.GetExchangeUser();

            if (user != null)
            {
                thisContactItem.Email1Address           = distributionList.PrimarySmtpAddress;
                thisContactItem.LastName                = distributionList.Name;
                thisContactItem.FirstName               = string.Empty;
                thisContactItem.BusinessTelephoneNumber = user.BusinessTelephoneNumber;
                thisContactItem.MobileTelephoneNumber   = user.MobileTelephoneNumber;
                thisContactItem.CompanyName             = user.CompanyName;
                thisContactItem.Department              = user.Department;
                thisContactItem.OfficeLocation          = user.OfficeLocation;
                thisContactItem.Save();
            }
        }
示例#13
0
        private void ProcessExchangeDistributionList(ExchangeDistributionList distributionList)
        {
            if (distributionList == null)
            {
                return;
            }
            var contact = _contacts.FirstOrDefault(c => c.Email1Address == distributionList.PrimarySmtpAddress);

            if (contact == null)
            {
                _folder.AddExchangeDistributionList(distributionList);
            }
            else
            {
                contact.Update(distributionList);
                _contacts.Remove(contact);
            }
        }
        private void BindSettings()
        {
            try
            {
                // get settings
                ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListMailFlowSettings(
                    PanelRequest.ItemID, PanelRequest.AccountID);

                litDisplayName.Text = dlist.DisplayName;

                // bind form
                acceptAccounts.SetAccounts(dlist.AcceptAccounts);
                chkSendersAuthenticated.Checked = dlist.RequireSenderAuthentication;
                rejectAccounts.SetAccounts(dlist.RejectAccounts);
            }
            catch (Exception ex)
            {
                messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_MAILFLOW", ex);
            }
        }
示例#15
0
        public void AddExchangeDistributionList(ExchangeDistributionList distributionList)
        {
            ContactItem newContact = GetSyncFolder().Items.Add("IPM.Contact") as ContactItem;

            newContact.Update(distributionList);
        }