internal static string GetSmtpNextHopDomain()
 {
     if (string.IsNullOrEmpty(ManagementEndpointBase.smtpNextHopFormat))
     {
         ManagementEndpointBase.smtpNextHopFormat = RegistrySettings.ExchangeServerCurrentVersion.SmtpNextHopDomainFormat;
     }
     return(string.Format(ManagementEndpointBase.smtpNextHopFormat, ManagementEndpointBase.GetLocalSite().PartnerId));
 }
        protected override void InternalProcessRecord()
        {
            base.InternalProcessRecord();
            if (!ManagementEndpointBase.IsGlobalDirectoryConfigured())
            {
                base.WriteWarning("Management endpoint code skipped in test environment.");
                return;
            }
            IGlobalDirectorySession session = this.GlobalDirectorySession(this.GetRedirectionTemplate());

            this.ProcessRedirectionEntry(session);
        }
Exemple #3
0
 internal override void ProcessRedirectionEntry(IGlobalDirectorySession session)
 {
     if (this.accountPartitionId != null)
     {
         ADForest localForest = ADForest.GetLocalForest();
         session.UpdateTenant(this.ExternalDirectoryOrganizationId, localForest.Fqdn, this.accountPartitionId.ForestFQDN, ManagementEndpointBase.GetSmtpNextHopDomain(), GlsTenantFlags.None, this.TenantContainerCN);
         return;
     }
     if (this.TenantFlag != null)
     {
         session.SetTenantFlag(this.ExternalDirectoryOrganizationId, this.TenantFlag.Value, true);
         return;
     }
     session.UpdateAcceptedDomain(this.ExternalDirectoryOrganizationId, this.DomainName.Domain);
 }
 internal override void ProcessRedirectionEntry(IGlobalDirectorySession session)
 {
     if (this.accountPartitionId != null)
     {
         ADForest localForest = ADForest.GetLocalForest();
         session.AddTenant(this.ExternalDirectoryOrganizationId, localForest.Fqdn, this.accountPartitionId.ForestFQDN, ManagementEndpointBase.GetSmtpNextHopDomain(), GlsTenantFlags.None, this.TenantContainerCN);
         if (this.PopulateCacheWithDomainName != null)
         {
             ADAccountPartitionLocator.AddTenantDataToCache(this.ExternalDirectoryOrganizationId, localForest.Fqdn, this.accountPartitionId.ForestFQDN, this.PopulateCacheWithDomainName.Domain, this.TenantContainerCN);
             return;
         }
     }
     else
     {
         session.AddAcceptedDomain(this.ExternalDirectoryOrganizationId, this.DomainName.Domain, this.InitialDomain);
     }
 }