private ADObjectId CreateOrganizationUnitContainer(string tenantContainerName, Guid sourceObjectGuid, Guid sourceObjectExchangeObjectId, ITenantConfigurationSession targetForestTenantSession)
        {
            ADOrganizationalUnit adorganizationalUnit = new ADOrganizationalUnit();

            adorganizationalUnit.CorrelationId        = sourceObjectGuid;
            adorganizationalUnit.ExchangeObjectId     = sourceObjectExchangeObjectId;
            adorganizationalUnit.RelocationInProgress = true;
            adorganizationalUnit.SetId(targetForestTenantSession.GetHostedOrganizationsRoot().GetChildId("OU", tenantContainerName));
            targetForestTenantSession.Save(adorganizationalUnit);
            return(adorganizationalUnit.Id);
        }
        private ADOrganizationalUnit CreateExchangeUSGContainer(string name, IConfigurationSession session, ADObjectId domain)
        {
            ADOrganizationalUnit adorganizationalUnit = this.FindExchangeUSGContainer(name, session, domain);

            if (adorganizationalUnit == null)
            {
                ADOrganizationalUnit adorganizationalUnit2 = new ADOrganizationalUnit();
                adorganizationalUnit2.SetId(domain.GetChildId("OU", name));
                session.Save(adorganizationalUnit2);
                adorganizationalUnit = this.FindExchangeUSGContainer(name, session, domain);
            }
            base.LogReadObject(adorganizationalUnit);
            return(adorganizationalUnit);
        }
        private ADOrganizationalUnit CreateHostedExchangeSGContainer(IConfigurationSession session, OrganizationId orgId)
        {
            ADOrganizationalUnit adorganizationalUnit = this.FindHostedExchangeSGContainer(session, orgId);

            if (adorganizationalUnit == null)
            {
                ADOrganizationalUnit adorganizationalUnit2 = new ADOrganizationalUnit();
                adorganizationalUnit2.SetId(orgId.OrganizationalUnit.GetChildId("OU", "Hosted Organization Security Groups"));
                ADObject adobject = adorganizationalUnit2;
                adobject.OrganizationId = orgId;
                session.Save(adorganizationalUnit2);
                adorganizationalUnit = this.FindHostedExchangeSGContainer(session, orgId);
            }
            base.LogReadObject(adorganizationalUnit);
            return(adorganizationalUnit);
        }