예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=DisconnectedMailbox&workflow=GetServerDropDown");

            try
            {
                PowerShellResults <JsonDictionary <object> > list = webServiceReference.GetList(null, null);
                if (list.Output != null && list.Output.Length > 0)
                {
                    Microsoft.Exchange.Management.ControlPanel.WebControls.ListView listView = (Microsoft.Exchange.Management.ControlPanel.WebControls.ListView) this.FindControl("disconnectedMailboxListView");
                    listView.Views = new List <ListItem>();
                    JsonDictionary <object>[] output = list.Output;
                    for (int i = 0; i < output.Length; i++)
                    {
                        Dictionary <string, object> dictionary = output[i];
                        listView.Views.Add(new ListItem((string)dictionary["Name"], (string)dictionary["Name"]));
                    }
                    listView.Views.Sort((ListItem item1, ListItem item2) => item1.Text.CompareTo(item2.Text));
                }
            }
            catch (TargetInvocationException ex)
            {
                throw ex.InnerException;
            }
            base.OnLoad(e);
        }
예제 #2
0
        private static void LoadTargetDeliveryDomain(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            WebServiceReference webServiceReference           = new WebServiceReference("~/DDI/DDIService.svc?schema=RemoteDomains");
            PowerShellResults <JsonDictionary <object> > list = webServiceReference.GetList(null, null);
            bool   flag  = false;
            string value = null;

            if (list.Output != null)
            {
                for (int i = 0; i < list.Output.Length; i++)
                {
                    Dictionary <string, object> dictionary = list.Output[i];
                    foreach (KeyValuePair <string, object> keyValuePair in dictionary)
                    {
                        if (keyValuePair.Key == "DomainName")
                        {
                            value = (string)keyValuePair.Value;
                        }
                        else if (keyValuePair.Key == "TargetDeliveryDomain")
                        {
                            flag = (bool)keyValuePair.Value;
                        }
                    }
                    if (flag)
                    {
                        break;
                    }
                    value = null;
                }
            }
            if (!list.ErrorRecords.IsNullOrEmpty())
            {
                string errorMessage = list.ErrorRecords[0].ToString();
                logError("EntHasTargetDeliveryDomain", errorMessage);
            }
            addValue("EntTargetDeliveryDomain", value);
            addValue("EntHasTargetDeliveryDomain", flag);
        }
예제 #3
0
        private EnumValue[] QueryDLPPolicies()
        {
            if (!RbacPrincipal.Current.IsInRole("Get-DLPPolicy"))
            {
                return(new EnumValue[0]);
            }
            WebServiceReference webServiceReference           = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=DLPPolicy&Workflow=GetPolicyList");
            PowerShellResults <JsonDictionary <object> > list = webServiceReference.GetList(null, null);

            if (list.Output != null)
            {
                List <EnumValue>          list2  = new List <EnumValue>();
                JsonDictionary <object>[] output = list.Output;
                for (int i = 0; i < output.Length; i++)
                {
                    Dictionary <string, object> dictionary = output[i];
                    string text = (string)dictionary["Name"];
                    list2.Add(new EnumValue(AntiXssEncoder.HtmlEncode(text, false), text));
                }
                return(list2.ToArray());
            }
            return(new EnumValue[0]);
        }
예제 #4
0
        private void FillDialPlanAndGWDropDown()
        {
            this.ddlDialPlan.Items.Add(new ListItem(Strings.AllDialplans, string.Empty));
            this.ddlIPGateway.Items.Add(new ListItem(Strings.AllGateways, string.Empty));
            SortOptions sortOptions = new SortOptions();

            sortOptions.PropertyName = "DisplayName";
            sortOptions.Direction    = SortDirection.Ascending;
            WebServiceReference webServiceReference            = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=UMIPGatewayService");
            PowerShellResults <JsonDictionary <object> > list  = webServiceReference.GetList(null, sortOptions);
            WebServiceReference webServiceReference2           = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=UMDialPlanService");
            PowerShellResults <JsonDictionary <object> > list2 = webServiceReference2.GetList(null, sortOptions);

            if (!list.Succeeded || !list2.Succeeded)
            {
                return;
            }
            Dictionary <string, Identity> dictionary = new Dictionary <string, Identity>();

            if (list.Output != null && list.Output.Length > 0)
            {
                JsonDictionary <object>[] output = list.Output;
                for (int i = 0; i < output.Length; i++)
                {
                    Dictionary <string, object> dictionary2 = output[i];
                    string   text     = (string)dictionary2["DisplayName"];
                    Identity identity = (Identity)dictionary2["Identity"];
                    dictionary.Add(text, identity);
                    this.ddlIPGateway.Items.Add(new ListItem(text, identity.RawIdentity));
                }
            }
            if (dictionary.Count > 0)
            {
                GWDropDownItems gwdropDownItems = new GWDropDownItems();
                gwdropDownItems.GatewayInfo = dictionary.Values.ToArray <Identity>();
                this.dialPlanToGatewaysMapping.Add(string.Empty, gwdropDownItems);
            }
            if (list2.Output != null && list2.Output.Length > 0)
            {
                JsonDictionary <object>[] output2 = list2.Output;
                for (int j = 0; j < output2.Length; j++)
                {
                    Dictionary <string, object> dictionary3 = output2[j];
                    this.ddlDialPlan.Items.Add(new ListItem((string)dictionary3["DisplayName"], ((Identity)dictionary3["Identity"]).RawIdentity));
                    IEnumerable <object> enumerable = (IEnumerable <object>)dictionary3["UMIPGateway"];
                    if (enumerable != null && enumerable.Any <object>())
                    {
                        List <Identity> list3 = new List <Identity>();
                        foreach (object obj in enumerable)
                        {
                            Identity identity2 = (Identity)obj;
                            Identity item;
                            if (dictionary.TryGetValue(identity2.DisplayName, out item))
                            {
                                list3.Add(item);
                            }
                        }
                        GWDropDownItems gwdropDownItems2 = new GWDropDownItems();
                        gwdropDownItems2.GatewayInfo = list3;
                        this.dialPlanToGatewaysMapping.Add(((Identity)dictionary3["Identity"]).RawIdentity, gwdropDownItems2);
                    }
                }
            }
        }