Ejemplo n.º 1
0
        public static ServiceEndpoint GetMsoEndpoint()
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 71, "GetMsoEndpoint", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\ForwardSync\\MSOOnboardingService.cs");
            ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();

            return(endpointContainer.GetEndpoint("MSOSyncEndpoint"));
        }
Ejemplo n.º 2
0
        private static string GetGraphUrl()
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 168, "GetGraphUrl", "f:\\15.00.1497\\sources\\dev\\UnifiedGroups\\src\\UnifiedGroups\\Common\\AADClientFactory.cs");
            ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
            ServiceEndpoint endpoint;

            try
            {
                endpoint = endpointContainer.GetEndpoint(ServiceEndpointId.AADGraphAPI);
            }
            catch (ServiceEndpointNotFoundException)
            {
                AADClientFactory.Tracer.TraceDebug(0L, "Unable to get the URL for the Graph API because the service endpoint was not found");
                return(null);
            }
            if (endpoint.Uri == null)
            {
                AADClientFactory.Tracer.TraceError(0L, "ServiceEndpoint for Graph API was found but the URL is not present");
                throw new ServiceEndpointNotFoundException(ServiceEndpointId.AADGraphAPI);
            }
            string text = endpoint.Uri.ToString();

            AADClientFactory.Tracer.TraceDebug <string>(0L, "Retrieved GraphURL from ServiceEndpoint: {0}", text);
            return(text);
        }
Ejemplo n.º 3
0
        private static Uri GetEndpoint(string serviceEndpointId)
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 129, "GetEndpoint", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\FederationProvisioning\\LiveConfiguration.cs");
            ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
            ServiceEndpoint endpoint = endpointContainer.GetEndpoint(serviceEndpointId);

            return(new Uri(endpoint.Uri.AbsoluteUri, UriKind.Absolute));
        }
 private void SetDefaultValue()
 {
     try
     {
         ServiceEndpointContainer endpointContainer = ((ITopologyConfigurationSession)base.DataSession).GetEndpointContainer();
         ServiceEndpoint          endpoint          = endpointContainer.GetEndpoint(ServiceEndpointId.DeltaSyncPartnerProvision);
         ServiceEndpoint          endpoint2         = endpointContainer.GetEndpoint(ServiceEndpointId.DeltaSyncPartnerSettings);
         ServiceEndpoint          endpoint3         = endpointContainer.GetEndpoint(ServiceEndpointId.DeltaSyncPartnerClientCertificate);
         if (!base.Fields.Contains("ProvisionUrl"))
         {
             this.ProvisionUrl = endpoint.Uri;
         }
         if (!base.Fields.Contains("SettingUrl"))
         {
             this.SettingUrl = endpoint2.Uri;
         }
         if (!base.Fields.Contains("LocalCertificate"))
         {
             this.LocalCertificate = endpoint3.CertificateSubject;
         }
         if (!base.Fields.Contains("RemoteCertificate"))
         {
             this.RemoteCertificate = endpoint.CertificateSubject;
         }
     }
     catch (ServiceEndpointNotFoundException exception)
     {
         base.WriteError(exception, ErrorCategory.ObjectNotFound, null);
     }
     catch (EndpointContainerNotFoundException exception2)
     {
         base.WriteError(exception2, ErrorCategory.ObjectNotFound, null);
     }
     catch (ADTransientException exception3)
     {
         base.WriteError(exception3, ErrorCategory.NotSpecified, null);
     }
     catch (ADOperationException exception4)
     {
         base.WriteError(exception4, ErrorCategory.NotSpecified, null);
     }
 }
Ejemplo n.º 5
0
 private static void InitializeEndpointLists()
 {
     if (TestEcpConnectivity2.consumerLiveIdHostNames == null)
     {
         lock (TestEcpConnectivity2.lockObject)
         {
             if (TestEcpConnectivity2.consumerLiveIdHostNames == null)
             {
                 ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 102, "InitializeEndpointLists", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Monitoring\\Tasks\\TestEcpConnectivity2.cs");
                 ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
                 TestEcpConnectivity2.exchangeHostNames = new List <string>();
                 TestEcpConnectivity2.exchangeHostNames.Add(endpointContainer.GetEndpoint(ServiceEndpointId.ExchangeLoginUrl).Uri.Host);
                 TestEcpConnectivity2.businessLiveIdHostNames = new List <string>();
                 TestEcpConnectivity2.businessLiveIdHostNames.Add(endpointContainer.GetEndpoint(ServiceEndpointId.MsoServiceLogin2).Uri.Host);
                 TestEcpConnectivity2.consumerLiveIdHostNames = new List <string>();
                 TestEcpConnectivity2.consumerLiveIdHostNames.Add(endpointContainer.GetEndpoint(ServiceEndpointId.LiveServiceLogin2).Uri.Host);
             }
         }
     }
 }
        private static ServiceEndpoint LoadServiceEndpoint()
        {
            ServiceEndpoint endpoint = LocatorServiceClientConfiguration.Instance.Endpoint;

            if (endpoint != null)
            {
                return(endpoint);
            }
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 163, "LoadServiceEndpoint", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\GlobalLocatorService\\LocatorServiceClientAdapter.cs");
            ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();

            return(endpointContainer.GetEndpoint("GlobalLocatorService"));
        }
 private void InitializeAnonymousCalendarHostUrl()
 {
     try
     {
         ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 141, "InitializeAnonymousCalendarHostUrl", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\ServiceDiscovery\\OwaAnonymousVdirLocater.cs");
         ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
         ServiceEndpoint endpoint = endpointContainer.GetEndpoint(ServiceEndpointId.AnonymousCalendarHostUrl);
         this.anonymousCalendarHostUrl = endpoint.Uri;
     }
     catch (EndpointContainerNotFoundException)
     {
     }
     catch (ServiceEndpointNotFoundException)
     {
     }
 }
 internal static void ReloadProvisioningParameters()
 {
     if (AcceptedDomainUtility.lastReadTime + AcceptedDomainUtility.reloadTimeSpan > DateTime.UtcNow)
     {
         return;
     }
     lock (AcceptedDomainUtility.LockObject)
     {
         if (!(AcceptedDomainUtility.lastReadTime + AcceptedDomainUtility.reloadTimeSpan > DateTime.UtcNow))
         {
             ServiceEndpoint serviceEndpoint  = null;
             ServiceEndpoint serviceEndpoint2 = null;
             ServiceEndpoint serviceEndpoint3 = null;
             ServiceEndpoint serviceEndpoint4 = null;
             ServiceEndpoint serviceEndpoint5 = null;
             try
             {
                 ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 138, "ReloadProvisioningParameters", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\MessageSecurity\\AcceptedDomain\\AcceptedDomainUtility.cs");
                 ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
                 serviceEndpoint  = endpointContainer.GetEndpoint(ServiceEndpointId.CoexistenceParentDomain);
                 serviceEndpoint2 = endpointContainer.GetEndpoint(ServiceEndpointId.CoexistenceDnsEndpoint);
                 serviceEndpoint3 = endpointContainer.GetEndpoint(ServiceEndpointId.CoexistenceMailDomainFfo15);
                 serviceEndpoint4 = endpointContainer.GetEndpoint(ServiceEndpointId.CoexistenceDnsCname);
                 serviceEndpoint5 = endpointContainer.GetEndpoint(ServiceEndpointId.CoexistenceDnsText);
             }
             catch (EndpointContainerNotFoundException)
             {
                 TaskLogger.Trace("EndpointContainer was not found.", new object[0]);
             }
             catch (ServiceEndpointNotFoundException)
             {
                 TaskLogger.Trace("At least one Coexistence Endpoint was not found.", new object[0]);
             }
             if (serviceEndpoint2 != null)
             {
                 AcceptedDomainUtility.dnsRegistrationEndpoint = serviceEndpoint2.Uri;
                 if (string.IsNullOrEmpty(serviceEndpoint2.CertificateSubject))
                 {
                     throw new Exception("Unable to find the certificate.");
                 }
                 AcceptedDomainUtility.dnsRegistrationCertificateSubject = serviceEndpoint2.CertificateSubject;
                 TaskLogger.Trace("Dns Registration Endpoint set to '{0}'", new object[]
                 {
                     AcceptedDomainUtility.dnsRegistrationEndpoint.ToString()
                 });
                 TaskLogger.Trace("Dns Registration Subject set to '{0}'", new object[]
                 {
                     AcceptedDomainUtility.dnsRegistrationCertificateSubject
                 });
             }
             AcceptedDomainUtility.coexistenceMailDomainFfo15 = ((serviceEndpoint3 != null) ? serviceEndpoint3.Uri.Host : string.Empty);
             TaskLogger.Trace("Coexistence Mail Domain with FFO 15 set to '{0}'", new object[]
             {
                 AcceptedDomainUtility.coexistenceMailDomainFfo15
             });
             AcceptedDomainUtility.coexistenceDnsCnameValue = ((serviceEndpoint4 != null) ? serviceEndpoint4.Uri.Host : "autodiscover.outlook.com");
             TaskLogger.Trace("Coexistence DNS CNAME value set to '{0}'", new object[]
             {
                 AcceptedDomainUtility.coexistenceDnsCnameValue
             });
             AcceptedDomainUtility.coexistenceDnsTextValue = string.Format("v=spf1 include:{0} -all", (serviceEndpoint5 != null) ? serviceEndpoint5.Uri.Host : "outlook.com");
             TaskLogger.Trace("Coexistence DNS TEXT value set to '{0}'", new object[]
             {
                 AcceptedDomainUtility.coexistenceDnsTextValue
             });
             AcceptedDomainUtility.lastReadTime = DateTime.UtcNow;
             string text = (serviceEndpoint != null) ? serviceEndpoint.Uri.Host : string.Empty;
             if (text != null && !text.StartsWith("."))
             {
                 text = "." + text;
             }
             AcceptedDomainUtility.coexistenceParentDomain = ((text != null) ? text : string.Empty);
             TaskLogger.Trace("Coexistence Parent Domain set to '{0}'", new object[]
             {
                 AcceptedDomainUtility.coexistenceParentDomain
             });
         }
     }
 }