Пример #1
0
 private static void ConnectArchiveCore(ADUser userToConnect, Guid deletedMailboxGuid, string parameterSetName, IRecipientSession recipientSession, IConfigurationSession configSession, MapiAdministrationSession mapiAdministrationSession, string alias, SecurityIdentifier linkedUserSid, DatabaseLocationInfo databaseLocationInfo, MailboxDatabase database, Task.TaskVerboseLoggingDelegate verboseLogger, Task.TaskWarningLoggingDelegate warningLogger)
 {
     userToConnect.ArchiveDatabase = (ADObjectId)database.Identity;
     userToConnect.ArchiveGuid     = deletedMailboxGuid;
     userToConnect.ArchiveName     = new MultiValuedProperty <string>(Strings.ArchiveNamePrefix + userToConnect.DisplayName);
     if (MailboxTaskHelper.SupportsMailboxReleaseVersioning(userToConnect))
     {
         userToConnect.ArchiveRelease = databaseLocationInfo.MailboxRelease;
     }
     userToConnect.ArchiveQuota        = ProvisioningHelper.DefaultArchiveQuota;
     userToConnect.ArchiveWarningQuota = ProvisioningHelper.DefaultArchiveWarningQuota;
     MailboxTaskHelper.ApplyDefaultArchivePolicy(userToConnect, configSession);
     recipientSession.Save(userToConnect);
     verboseLogger(Strings.VerboseADOperationSucceeded(userToConnect.Identity.ToString()));
     ConnectMailbox.UpdateSDAndRefreshMailbox(mapiAdministrationSession, userToConnect, database, deletedMailboxGuid, parameterSetName, verboseLogger, warningLogger);
 }
Пример #2
0
 private void CreateArchiveIfNecessary(ADUser user)
 {
     if (user.ArchiveGuid == Guid.Empty)
     {
         if (user.DisabledArchiveGuid != Guid.Empty && this.ArchiveGuid == user.DisabledArchiveGuid)
         {
             this.recoverArchive = MailboxTaskHelper.IsArchiveRecoverable(user, this.ConfigurationSession, RecipientTaskHelper.CreatePartitionOrRootOrgScopedGcSession(base.DomainController, user.Id));
             if (this.recoverArchive)
             {
                 user.ArchiveDatabase = user.DisabledArchiveDatabase;
             }
         }
         user.ArchiveGuid             = this.ArchiveGuid;
         user.ArchiveName             = ((this.ArchiveName == null) ? new MultiValuedProperty <string>(Strings.ArchiveNamePrefix + user.DisplayName) : this.ArchiveName);
         user.ArchiveQuota            = RecipientConstants.ArchiveAddOnQuota;
         user.ArchiveWarningQuota     = RecipientConstants.ArchiveAddOnWarningQuota;
         user.ArchiveStatus          |= ArchiveStatusFlags.Active;
         user.AllowArchiveAddressSync = true;
         MailboxTaskHelper.ApplyDefaultArchivePolicy(user, this.ConfigurationSession);
         return;
     }
     base.WriteError(new RecipientTaskException(Strings.ErrorArchiveAlreadyPresent(this.Identity.ToString())), ErrorCategory.InvalidArgument, null);
 }