コード例 #1
0
 protected override void ModifyRequestInternal(TransactionalRequestJob requestJob, StringBuilder changedValuesTracker)
 {
     base.ModifyRequestInternal(requestJob, changedValuesTracker);
     if (base.IsFieldSet("SkipMoving"))
     {
         RequestJobInternalFlags requestJobInternalFlags = requestJob.RequestJobInternalFlags;
         RequestTaskHelper.SetSkipMoving(this.SkipMoving, requestJob, new Task.TaskErrorLoggingDelegate(base.WriteError), true);
         changedValuesTracker.AppendLine(string.Format("InternalFlags: {0} -> {1}", requestJobInternalFlags, requestJob.RequestJobInternalFlags));
     }
 }
コード例 #2
0
 protected override void SetRequestProperties(TransactionalRequestJob dataObject)
 {
     base.SetRequestProperties(dataObject);
     dataObject.RequestType  = MRSRequestType.MailboxRelocation;
     dataObject.JobType      = MRSJobType.RequestJobE15_AutoResume;
     dataObject.UserId       = this.mailbox.Id;
     dataObject.ExchangeGuid = this.mailbox.ExchangeGuid;
     RequestTaskHelper.ApplyOrganization(dataObject, this.mailbox.OrganizationId ?? OrganizationId.ForestWideOrgId);
     dataObject.UserOrgName       = ((this.mailbox.OrganizationId != null && this.mailbox.OrganizationId.OrganizationalUnit != null) ? this.mailbox.OrganizationId.OrganizationalUnit.Name : this.mailbox.Id.DomainId.ToString());
     dataObject.DistinguishedName = this.mailbox.DistinguishedName;
     dataObject.DisplayName       = this.mailbox.DisplayName;
     dataObject.Alias             = this.mailbox.Alias;
     dataObject.User = this.mailbox;
     dataObject.DomainControllerToUpdate = this.mailbox.OriginatingServer;
     dataObject.SourceDatabase           = ADObjectIdResolutionHelper.ResolveDN(this.mailbox.Database);
     dataObject.SourceVersion            = this.sourceDatabaseInformation.Value.ServerVersion;
     this.ChooseTargetMailboxDatabase(dataObject);
     dataObject.PreserveMailboxSignature = false;
     dataObject.IncrementalSyncInterval  = NewMailboxRelocationRequest.incrementalSyncInterval;
     dataObject.AllowLargeItems          = true;
     RequestTaskHelper.SetSkipMoving(this.SkipMoving, dataObject, new Task.TaskErrorLoggingDelegate(base.WriteError), true);
 }
コード例 #3
0
        protected override void ModifyMoveRequest(TransactionalRequestJob moveRequest)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("Set-MoveRequest changed values:");
            this.mdbGuid = moveRequest.WorkItemQueueMdb.ObjectGuid;
            if (base.LocalADUser != null)
            {
                moveRequest.DomainControllerToUpdate = base.LocalADUser.OriginatingServer;
            }
            if (base.IsFieldSet("SuspendWhenReadyToComplete"))
            {
                stringBuilder.AppendLine(string.Format("SWRTC: {0} -> {1}", moveRequest.SuspendWhenReadyToComplete, this.SuspendWhenReadyToComplete));
                moveRequest.SuspendWhenReadyToComplete = this.SuspendWhenReadyToComplete;
            }
            if (base.IsFieldSet("RemoteCredential"))
            {
                string remoteCredentialUsername = moveRequest.RemoteCredentialUsername;
                moveRequest.RemoteCredential = RequestTaskHelper.GetNetworkCredential(this.RemoteCredential, null);
                stringBuilder.AppendLine(string.Format("RemoteCredential: {0}:<pwd> -> {1}:<pwd>", remoteCredentialUsername, moveRequest.RemoteCredentialUsername));
                if ((moveRequest.Flags & RequestFlags.RemoteLegacy) != RequestFlags.None)
                {
                    if (moveRequest.Direction == RequestDirection.Pull)
                    {
                        moveRequest.SourceCredential = moveRequest.RemoteCredential;
                    }
                    else
                    {
                        moveRequest.TargetCredential = moveRequest.RemoteCredential;
                    }
                }
            }
            if (base.IsFieldSet("RemoteGlobalCatalog"))
            {
                string arg;
                if ((moveRequest.Flags & RequestFlags.RemoteLegacy) != RequestFlags.None)
                {
                    if (moveRequest.Direction == RequestDirection.Pull)
                    {
                        arg = moveRequest.SourceDCName;
                        moveRequest.SourceDCName = this.RemoteGlobalCatalog;
                    }
                    else
                    {
                        arg = moveRequest.TargetDCName;
                        moveRequest.TargetDCName = this.RemoteGlobalCatalog;
                    }
                }
                else
                {
                    arg = moveRequest.RemoteDomainControllerToUpdate;
                    moveRequest.RemoteDomainControllerToUpdate = this.RemoteGlobalCatalog;
                }
                stringBuilder.AppendLine(string.Format("RemoteGC: {0} -> {1}", arg, this.RemoteGlobalCatalog));
            }
            if (base.IsFieldSet("RemoteHostName"))
            {
                stringBuilder.AppendLine(string.Format("RemoteHostName: {0} -> {1}", moveRequest.RemoteHostName, this.RemoteHostName));
                moveRequest.RemoteHostName = this.RemoteHostName;
            }
            if (base.IsFieldSet("BadItemLimit"))
            {
                stringBuilder.AppendLine(string.Format("BadItemLimit: {0} -> {1}", moveRequest.BadItemLimit, this.BadItemLimit));
                moveRequest.BadItemLimit = this.BadItemLimit;
            }
            if (base.IsFieldSet("LargeItemLimit"))
            {
                stringBuilder.AppendLine(string.Format("LargeItemLimit: {0} -> {1}", moveRequest.LargeItemLimit, this.LargeItemLimit));
                moveRequest.LargeItemLimit = this.LargeItemLimit;
            }
            if (base.IsFieldSet("Protect"))
            {
                stringBuilder.AppendLine(string.Format("Protect: {0} -> {1}", moveRequest.Protect, this.Protect));
                moveRequest.Protect = this.Protect;
            }
            if (base.IsFieldSet("IgnoreRuleLimitErrors"))
            {
                stringBuilder.AppendLine(string.Format("IgnoreRuleLimitErrors: {0} -> {1}", moveRequest.IgnoreRuleLimitErrors, this.IgnoreRuleLimitErrors));
                moveRequest.IgnoreRuleLimitErrors = this.IgnoreRuleLimitErrors;
            }
            if (base.IsFieldSet("BatchName"))
            {
                stringBuilder.AppendLine(string.Format("BatchName: {0} -> {1}", moveRequest.BatchName, this.BatchName));
                moveRequest.BatchName = this.BatchName;
            }
            if (base.IsFieldSet("Priority"))
            {
                stringBuilder.AppendLine(string.Format("Priority: {0} -> {1}", moveRequest.Priority, this.Priority));
                moveRequest.Priority = this.Priority;
            }
            if (base.IsFieldSet("CompletedRequestAgeLimit"))
            {
                stringBuilder.AppendLine(string.Format("CompletedRequestAgeLimit: {0} -> {1}", moveRequest.CompletedRequestAgeLimit, this.CompletedRequestAgeLimit));
                moveRequest.CompletedRequestAgeLimit = this.CompletedRequestAgeLimit;
            }
            if (base.IsFieldSet("PreventCompletion"))
            {
                stringBuilder.AppendLine(string.Format("PreventCompletion: {0} -> {1}", moveRequest.PreventCompletion, this.PreventCompletion));
                moveRequest.PreventCompletion = this.PreventCompletion;
            }
            if (base.IsFieldSet("StartAfter") && !RequestTaskHelper.CompareUtcTimeWithLocalTime(moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.StartAfter), this.StartAfter))
            {
                RequestTaskHelper.SetStartAfter(this.StartAfter, moveRequest, stringBuilder);
            }
            if (base.IsFieldSet("CompleteAfter") && !RequestTaskHelper.CompareUtcTimeWithLocalTime(moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.CompleteAfter), this.CompleteAfter))
            {
                RequestTaskHelper.SetCompleteAfter(this.CompleteAfter, moveRequest, stringBuilder);
            }
            if (base.IsFieldSet("IncrementalSyncInterval"))
            {
                moveRequest.IncrementalSyncInterval = this.IncrementalSyncInterval;
            }
            RequestTaskHelper.ValidateStartAfterCompleteAfterWithSuspendWhenReadyToComplete(moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.StartAfter), moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.CompleteAfter), moveRequest.SuspendWhenReadyToComplete, new Task.TaskErrorLoggingDelegate(base.WriteError));
            RequestTaskHelper.ValidateStartAfterComesBeforeCompleteAfter(moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.StartAfter), moveRequest.TimeTracker.GetTimestamp(RequestJobTimestamp.CompleteAfter), new Task.TaskErrorLoggingDelegate(base.WriteError));
            if (base.IsFieldSet("SkipMoving"))
            {
                RequestJobInternalFlags requestJobInternalFlags = moveRequest.RequestJobInternalFlags;
                RequestTaskHelper.SetSkipMoving(this.SkipMoving, moveRequest, new Task.TaskErrorLoggingDelegate(base.WriteError), true);
                stringBuilder.AppendLine(string.Format("InternalFlags: {0} -> {1}", requestJobInternalFlags, moveRequest.RequestJobInternalFlags));
            }
            if (base.IsFieldSet("InternalFlags"))
            {
                RequestJobInternalFlags requestJobInternalFlags2 = moveRequest.RequestJobInternalFlags;
                RequestTaskHelper.SetInternalFlags(this.InternalFlags, moveRequest, new Task.TaskErrorLoggingDelegate(base.WriteError));
                stringBuilder.AppendLine(string.Format("InternalFlags: {0} -> {1}", requestJobInternalFlags2, moveRequest.RequestJobInternalFlags));
            }
            ReportData      reportData      = new ReportData(moveRequest.ExchangeGuid, moveRequest.ReportVersion);
            ConnectivityRec connectivityRec = new ConnectivityRec(ServerKind.Cmdlet, VersionInformation.MRS);

            reportData.Append(MrsStrings.ReportMoveRequestSet(base.ExecutingUserIdentity), connectivityRec);
            reportData.AppendDebug(stringBuilder.ToString());
            if (this.AcceptLargeDataLoss)
            {
                reportData.Append(MrsStrings.ReportLargeAmountOfDataLossAccepted2(moveRequest.BadItemLimit.ToString(), moveRequest.LargeItemLimit.ToString(), base.ExecutingUserIdentity));
            }
            if (base.IsFieldSet("TargetDatabase") || base.IsFieldSet("ArchiveTargetDatabase"))
            {
                moveRequest.RehomeRequest = true;
                if (base.IsFieldSet("TargetDatabase"))
                {
                    moveRequest.TargetDatabase = this.specifiedTargetMDB.Id;
                }
                if (base.IsFieldSet("ArchiveTargetDatabase"))
                {
                    moveRequest.TargetArchiveDatabase = this.specifiedArchiveTargetMDB.Id;
                }
            }
            reportData.Flush(base.MRProvider.SystemMailbox);
        }