Exemple #1
0
 private void InitializeForwardingAddress(UMIPGateway gw)
 {
     if (gw.GlobalCallRoutingScheme == UMGlobalCallRoutingScheme.GatewayGuid)
     {
         Guid guid = gw.Guid;
         ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 111, "InitializeForwardingAddress", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\um\\GetUMIPGateway.cs");
         Server          server = topologyConfigurationSession.FindLocalServer();
         List <UMServer> compatibleUMRpcServers = Utility.GetCompatibleUMRpcServers(server.ServerSite, null, topologyConfigurationSession);
         string          text = string.Empty;
         using (List <UMServer> .Enumerator enumerator = compatibleUMRpcServers.GetEnumerator())
         {
             if (enumerator.MoveNext())
             {
                 UMServer umserver = enumerator.Current;
                 text = umserver.UMForwardingAddressTemplate;
             }
         }
         ADSessionSettings         sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(ADSystemConfigurationSession.GetRootOrgContainerIdForLocalForest(), gw.OrganizationId, null, false);
         IConfigurationSession     tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 139, "InitializeForwardingAddress", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\um\\GetUMIPGateway.cs");
         ExchangeConfigurationUnit exchangeConfigurationUnit            = tenantOrTopologyConfigurationSession.Read <ExchangeConfigurationUnit>(gw.ConfigurationUnit);
         if (!string.IsNullOrEmpty(text) && exchangeConfigurationUnit != null && !string.IsNullOrEmpty(exchangeConfigurationUnit.ExternalDirectoryOrganizationId))
         {
             gw.ForwardingAddress = string.Format(CultureInfo.InvariantCulture, text, new object[]
             {
                 exchangeConfigurationUnit.ExternalDirectoryOrganizationId
             });
         }
     }
 }
Exemple #2
0
        private static void SetUMCertificate(X509Certificate2 cert, Server server, IConfigurationSession dataSession, bool allowConfirmation, Dictionary <AllowedServices, LocalizedString> confirmationStrings, List <LocalizedString> warningList)
        {
            UMServer umserver = new UMServer(server);

            if (!server.IsUnifiedMessagingServer)
            {
                throw new UMRoleNotInstalledException(cert.Thumbprint, server.Name);
            }
            if (umserver.UMStartupMode == UMStartupMode.TCP)
            {
                throw new CannotAssignCertificateToUMException(cert.Thumbprint);
            }
            if (CertificateUtils.IsExpired(cert))
            {
                throw new CertificateExpiredException(cert.Thumbprint);
            }
            if (allowConfirmation)
            {
                confirmationStrings[AllowedServices.UM] = Strings.ConfirmEnableCertForUM(cert.Thumbprint);
                return;
            }
            bool flag = false;

            if (string.IsNullOrEmpty(umserver.UMCertificateThumbprint))
            {
                flag = true;
            }
            ManageExchangeCertificate.CopyCertToRootStoreIfNeeded(cert, server);
            umserver.UMCertificateThumbprint = cert.Thumbprint;
            dataSession.Save(server);
            if (warningList != null && flag)
            {
                warningList.Add(Strings.ExchangeCertificateUpdatedForUM(server.Name));
            }
        }
 // Token: 0x060008CB RID: 2251 RVA: 0x0001ED37 File Offset: 0x0001CF37
 public ServerIdParameter(UMServer umServer) : base(umServer.Id)
 {
 }
Exemple #4
0
        protected override void InternalProcessRecord()
        {
            string serverName = string.Empty;

            try
            {
                TaskLogger.LogEnter();
                if (this.IPGateway != null)
                {
                    UMIPGateway     umipgateway = (UMIPGateway)this.adResults;
                    List <UMServer> compatibleUMRpcServerList = Utility.GetCompatibleUMRpcServerList(null, this.rootOrgConfigSession);
                    using (List <UMServer> .Enumerator enumerator = compatibleUMRpcServerList.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            UMServer umserver = enumerator.Current;
                            serverName = umserver.Name;
                            ActiveCalls[] dataObjects = this.InvokeGetActiveCalls(serverName, null, umipgateway.Address.ToString());
                            this.WriteResults(dataObjects);
                        }
                        goto IL_175;
                    }
                }
                if (this.DialPlan != null)
                {
                    UMDialPlan      umdialPlan = (UMDialPlan)this.adResults;
                    List <UMServer> compatibleUMRpcServerList2 = Utility.GetCompatibleUMRpcServerList(umdialPlan, this.rootOrgConfigSession);
                    using (List <UMServer> .Enumerator enumerator2 = compatibleUMRpcServerList2.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            UMServer umserver2 = enumerator2.Current;
                            serverName = umserver2.Name;
                            ActiveCalls[] dataObjects2 = this.InvokeGetActiveCalls(serverName, umdialPlan.Name, null);
                            this.WriteResults(dataObjects2);
                        }
                        goto IL_175;
                    }
                }
                if (this.Server != null)
                {
                    Server server = (Server)this.adResults;
                    serverName = server.Name;
                    ActiveCalls[] dataObjects3 = this.InvokeGetActiveCalls(serverName, null, null);
                    this.WriteResults(dataObjects3);
                }
                else if (this.InstanceServer != null)
                {
                    serverName = this.InstanceServer.Name;
                    ActiveCalls[] dataObjects4 = this.InvokeGetActiveCalls(serverName, null, null);
                    this.WriteResults(dataObjects4);
                }
                else
                {
                    serverName = "localhost";
                    ActiveCalls[] dataObjects5 = this.InvokeGetActiveCalls(serverName, null, null);
                    this.WriteResults(dataObjects5);
                }
IL_175:
                TaskLogger.LogExit();
            }
            catch (RpcException e)
            {
                this.WriteRpcError(e, serverName);
            }
        }