Exemplo n.º 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);
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            string value = this.Context.Request.QueryString["Identity"];

            if (string.IsNullOrEmpty(value))
            {
                throw new BadQueryParameterException("Identity");
            }
            if (string.IsNullOrEmpty(this.Context.Request.QueryString["Name"]))
            {
                throw new BadQueryParameterException("Name");
            }
            if (string.IsNullOrEmpty(this.Context.Request.QueryString["HandlerClass"]))
            {
                throw new BadQueryParameterException("HandlerClass");
            }
            Identity            identity            = Identity.FromIdParameter(value);
            WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=MigrationReport");
            PowerShellResults <JsonDictionary <object> > powerShellResults = (PowerShellResults <JsonDictionary <object> >)webServiceReference.GetObject(identity);

            if (!powerShellResults.SucceededWithValue)
            {
                throw new BadQueryParameterException("Identity");
            }
            if ((MigrationType)powerShellResults.Output[0]["MigrationType"] == MigrationType.BulkProvisioning)
            {
                this.OverrideStringsForBulkProvisioning();
            }
            if (this.linkShowReport != null)
            {
                this.linkShowReport.NavigateUrl = this.Context.Request.RawUrl.Replace("DownloadReport.aspx?", "Download.aspx?");
            }
            base.OnLoad(e);
        }
Exemplo n.º 3
0
        private void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            descriptor.AddElementProperty("SearchButton", this.searchButton.ClientID, true);
            descriptor.AddElementProperty("ClearButton", this.clearButton.ClientID, true);
            descriptor.AddComponentProperty("FromEditor", this.senderMatches.ClientID, true);
            descriptor.AddComponentProperty("ToEditor", this.recipientMatches.ClientID, true);
            descriptor.AddElementProperty("MessageIDTextBox", this.messageIDTextBox.ClientID, true);
            descriptor.AddElementProperty("ClientIPTextBox", this.originalClientIPTextbox.ClientID, true);
            descriptor.AddElementProperty("ReportTitleTextBox", this.reportTitleTextbox.ClientID, true);
            descriptor.AddElementProperty("NotifyAddressTextBox", this.emailTextbox.ClientID, true);
            descriptor.AddElementProperty("DdMessageTimeFrame", this.ddMessageTimeframe.ClientID, true);
            descriptor.AddElementProperty("DdDeliveryStatus", this.ddDeliveryStatus.ClientID, true);
            descriptor.AddElementProperty("DdDeliveryStatusEx", this.ddDeliveryStatusEx.ClientID, true);
            descriptor.AddElementProperty("DirectionDropdown", this.ddDirection.ClientID, true);
            descriptor.AddElementProperty("TimeZoneDropdown", this.ddTimeZone.ClientID, true);
            descriptor.AddElementProperty("ReportOptionsPanel", "panelOnDemandOptions", true);
            descriptor.AddElementProperty("DateRangePanel", "dateRangePanel", true);
            descriptor.AddElementProperty("IncludeReportDetails", this.chkReportDetails.ClientID, true);
            descriptor.AddComponentProperty("StartDate", this.startDate.ClientID, true);
            descriptor.AddComponentProperty("EndDate", this.endDate.ClientID, true);
            descriptor.AddComponentProperty("DockPanel", this.dockpanel.ClientID, true);
            WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=MessageTraceEx");

            descriptor.AddProperty("ServiceUrl", EcpUrl.ProcessUrl(webServiceReference.ServiceUrl));
        }
Exemplo n.º 4
0
        protected void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            descriptor.AddElementProperty("SenderDomainTextArea", this.txtSenderDomainList.ClientID, true);
            descriptor.AddElementProperty("SearchButton", this.searchButton.ClientID, true);
            descriptor.AddElementProperty("ClearButton", this.clearButton.ClientID, true);
            descriptor.AddComponentProperty("BannedSenderCollectionEditor", this.bannedSenderCollectionEditor.ClientID, true);
            descriptor.AddComponentProperty("CollectionEditorRefreshMethod", this.bannedSenderDataSource.RefreshWebServiceMethod.ClientID, true);
            WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=BannedSender");

            descriptor.AddProperty("ServiceUrl", EcpUrl.ProcessUrl(webServiceReference.ServiceUrl));
        }
Exemplo n.º 5
0
            public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
            {
                WebServiceReference webServiceReference = value as WebServiceReference;

                if (destinationType == typeof(InstanceDescriptor) && webServiceReference != null)
                {
                    ConstructorInfo constructor = typeof(WebServiceReference).GetConstructor(new Type[]
                    {
                        typeof(string)
                    });
                    return(new InstanceDescriptor(constructor, new object[]
                    {
                        webServiceReference.ServiceUrl
                    }, true));
                }
                return(base.ConvertTo(context, culture, value, destinationType));
            }
Exemplo n.º 6
0
        private static void LoadCrossPremiseServiceInstance(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            string value = string.Empty;

            try
            {
                WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=HybridConfigurationWizardService&workflow=GetServiceInstance");
                PowerShellResults <JsonDictionary <object> > powerShellResults = (PowerShellResults <JsonDictionary <object> >)webServiceReference.GetObject(null);
                if (powerShellResults.Output.Length > 0)
                {
                    value = (string)powerShellResults.Output[0].RawDictionary["ServiceInstance"];
                }
            }
            catch (Exception ex)
            {
                logError("ServiceInstance", ex.ToString());
            }
            addValue("ServiceInstance", value);
        }
Exemplo n.º 7
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);
        }
        private void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            descriptor.AddElementProperty("SubmitButton", this.submitButton.ClientID, true);
            descriptor.AddElementProperty("CloseButton", this.closeButton.ClientID, true);
            descriptor.AddComponentProperty("FromEditor", this.senderMatches.ClientID, true);
            descriptor.AddComponentProperty("ToEditor", this.recipientMatches.ClientID, true);
            descriptor.AddElementProperty("MessageIDTextBox", this.messageIDTextBox.ClientID, true);
            descriptor.AddElementProperty("ClientIPTextBox", this.originalClientIPTextbox.ClientID, true);
            descriptor.AddElementProperty("ReportTitleTextBox", this.reportTitleTextbox.ClientID, true);
            string value = ExDateTime.UtcNow.ToUserExDateTime().ToString();

            descriptor.AddProperty("ServerDate", value, true);
            descriptor.AddElementProperty("NotifyAddressTextBox", this.emailTextbox.ClientID, true);
            descriptor.AddElementProperty("DdDeliveryStatusEx", this.ddDeliveryStatusEx.ClientID, true);
            descriptor.AddElementProperty("ReportOptionsPanel", "panelOnDemandOptions", true);
            descriptor.AddElementProperty("DateRangePanel", "dateRangePanel", true);
            descriptor.AddComponentProperty("StartDate", this.startDate.ClientID, true);
            descriptor.AddComponentProperty("EndDate", this.endDate.ClientID, true);
            descriptor.AddComponentProperty("DockPanel", this.dockpanel.ClientID, true);
            WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=ExtendedReportRequest");

            descriptor.AddProperty("ServiceUrl", EcpUrl.ProcessUrl(webServiceReference.ServiceUrl));
        }
Exemplo n.º 9
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]);
        }
Exemplo n.º 10
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);
                    }
                }
            }
        }