예제 #1
0
 private static MailboxMoveHelper.Scenario GetScenario(UserHoster sourceHoster, UserHoster targetHoster)
 {
     if (sourceHoster == UserHoster.None)
     {
         throw new ArgumentException("The hoster of source ADUser should not be None.", "sourceHoster");
     }
     if (targetHoster == UserHoster.None)
     {
         throw new ArgumentException("The hoster of target ADUser should not be None.", "targetHoster");
     }
     if (sourceHoster == UserHoster.OnPremise)
     {
         if (targetHoster != UserHoster.Datacenter)
         {
             return(MailboxMoveHelper.Scenario.CrossForest);
         }
         return(MailboxMoveHelper.Scenario.CrossPremiseOnboarding);
     }
     else
     {
         if (targetHoster != UserHoster.Datacenter)
         {
             return(MailboxMoveHelper.Scenario.CrossPremiseOffboarding);
         }
         return(MailboxMoveHelper.Scenario.CrossDatacenter);
     }
 }
예제 #2
0
 public static void UpdateRecipientTypeProperties(ADUser source, UserHoster sourceHoster, int sourceServerVersion, ADUser target, UserHoster targetHoster, int targetServerVersion, MailboxMoveType moveType, MailboxMoveTransition transition)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (transition == MailboxMoveTransition.IntraOrg)
     {
         if (MailboxMoveHelper.IsMovingPrimary(moveType))
         {
             MailboxMoveHelper.UpdateRecipientTypePropertiesForIntraOrg(target, targetServerVersion);
         }
         return;
     }
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     if (!source.propertyBag.Contains(ADUserSchema.UserAccountControl))
     {
         throw new ArgumentException("Source ADUser missed property: UserAccountControl", "source");
     }
     if (!target.propertyBag.Contains(ADUserSchema.UserAccountControl))
     {
         throw new ArgumentException("Target ADUser missed property: UserAccountControl", "target");
     }
     if (transition == MailboxMoveTransition.UpdateSourceUser && sourceServerVersion == 0)
     {
         throw new ArgumentException("Version of source mailbox server is required", "sourceServerVersion");
     }
     if (transition == MailboxMoveTransition.UpdateTargetUser && targetServerVersion == 0)
     {
         throw new ArgumentException("Version of target mailbox server is required", "targetServerVersion");
     }
     MailboxMoveHelper.Scenario scenario = MailboxMoveHelper.GetScenario(sourceHoster, targetHoster);
     if (scenario == MailboxMoveHelper.Scenario.CrossPremiseOnboarding && sourceServerVersion < Server.E14SP1MinVersion)
     {
         sourceServerVersion = Server.E14SP1MinVersion;
     }
     MailboxMoveHelper.UpdateRecipientTypeProperties(source, sourceServerVersion, target, targetServerVersion, scenario, moveType, transition);
 }