private bool RunAsAccountDistributionDialog()
        {
            byte[] runAsSsid = base.SharedUserData["SBWSNamespaceDetails.RunAsSsid"] as byte[];
            string runAsName = base.SharedUserData["SBWSNamespaceDetails.RunAsName"] as string;

            sbwsHostComputer = GetSBWSHostComputer(this.sbwsHostNameBrowseTextBox.Text);

            SecureData securedData = base.ManagementGroup.Security.GetSecureData(runAsSsid);

            if (securedData == null)
            {
                return(false);
            }

            IApprovedHealthServicesForDistribution <PartialMonitoringObject> newState = base.ManagementGroup.Security.GetApprovedHealthServicesForDistribution <PartialMonitoringObject>(securedData);

            if (newState == null)
            {
                return(false);
            }
            bool flag2 = newState.Result.Equals(ApprovedHealthServicesResults.All) || newState.HealthServices.Contains(sbwsHostComputer);

            if (!flag2)
            {
                string        text    = string.Empty;
                StringBuilder builder = new StringBuilder();
                if (!flag2)
                {
                    builder.AppendLine(runAsName);
                }
                //TODO: Fix this language
                text = string.Format("To enable discovery of the queues/topics/subscriptions on Service Bus for Windows Server Namespace <{0}>, the following Run As account must be distributed to the health service '{1}':\n\n{2}\n\nWould you like Operations Manager to distribute the accounts?", this.sbwsNamespaceNameTextBox.Text, this.sbwsHostComputer.DisplayName, builder.ToString());
                if (MessageBox.Show(base.ParentForm, text, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes)
                {
                    return(false);
                }
                if (!flag2)
                {
                    newState.Result = ApprovedHealthServicesResults.Specified;
                    newState.HealthServices.Add(sbwsHostComputer);
                    base.ManagementGroup.Security.SetApprovedHealthServicesForDistribution <PartialMonitoringObject>(securedData, newState);
                }
            }
            return(true);
        }
コード例 #2
0
        private bool RunAsAccountDistributionDialog()
        {
            this.GetSharedUserData();

            SecureData securedData = base.ManagementGroup.Security.GetSecureData(this.runAsSsid);

            if (securedData == null)
            {
                return(false);
            }

            IApprovedHealthServicesForDistribution <PartialMonitoringObject> newState = base.ManagementGroup.Security.GetApprovedHealthServicesForDistribution <PartialMonitoringObject>(securedData);

            if (newState == null)
            {
                return(false);
            }
            bool flag2 = newState.Result.Equals(ApprovedHealthServicesResults.All) || newState.HealthServices.Contains(this.proxyAgentComputer);

            if (!flag2)
            {
                string        text    = string.Empty;
                StringBuilder builder = new StringBuilder();
                if (!flag2)
                {
                    builder.AppendLine(this.runAsName);
                }
                //TODO: Fix this language
                text = string.Format("To enable discovery of databases on SQL Azure Server <{0}>, the following Run As account must be distributed to the health service '{1}':\n\n{2}\n\nWould you like Operations Manager to distribute the accounts?", this.ASBNamespaceName, this.proxyAgentComputer.DisplayName, builder.ToString());
                if (MessageBox.Show(base.ParentForm, text, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes)
                {
                    return(false);
                }
                if (!flag2)
                {
                    newState.Result = ApprovedHealthServicesResults.Specified;
                    newState.HealthServices.Add(this.proxyAgentComputer);
                    base.ManagementGroup.Security.SetApprovedHealthServicesForDistribution <PartialMonitoringObject>(securedData, newState);
                }
            }
            return(true);
        }