public static ExchangeConfigurationUnit GetExchangeConfigurationUnit(ADObjectId organizationMailboxId)
        {
            if (!ADSession.IsTenantIdentity(organizationMailboxId, organizationMailboxId.GetPartitionId().ForestFQDN))
            {
                throw new InvalidOperationException();
            }
            ADSessionSettings           sessionSettings            = ADSessionSettings.FromAllTenantsObjectId(organizationMailboxId);
            ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ConsistencyMode.IgnoreInvalid, sessionSettings, 495, "GetExchangeConfigurationUnit", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\OrganizationMailbox\\OrganizationMailbox.cs");
            ExchangePrincipal           exchangePrincipal          = OrganizationMailbox.GetExchangePrincipal(organizationMailboxId);

            return(tenantConfigurationSession.Read <ExchangeConfigurationUnit>(exchangePrincipal.MailboxInfo.OrganizationId.ConfigurationUnit));
        }
 public static ADObjectId GetActiveServerSite(ADObjectId organizationMailboxId)
 {
     return(OrganizationMailbox.GetExchangePrincipal(organizationMailboxId).MailboxInfo.Location.ServerSite);
 }