protected override IConfigurable ResolveDataObject() { ADRecipient adrecipient = (ADRecipient)base.ResolveDataObject(); if (MailboxTaskHelper.ExcludeArbitrationMailbox(adrecipient, base.Arbitration) || MailboxTaskHelper.ExcludePublicFolderMailbox(adrecipient, base.PublicFolder) || MailboxTaskHelper.ExcludeGroupMailbox(adrecipient, false) || MailboxTaskHelper.ExcludeMailboxPlan(adrecipient, false) || MailboxTaskHelper.ExcludeAuditLogMailbox(adrecipient, base.AuditLog)) { base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(ADUser).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ExchangeErrorCategory.Client, this.Identity); } if (adrecipient != null && adrecipient.RecipientTypeDetails == RecipientTypeDetails.TeamMailbox) { TeamMailbox teamMailbox = TeamMailbox.FromDataObject((ADUser)adrecipient); teamMailbox.ClosedTime = new DateTime?(DateTime.UtcNow); this.removeTeamMailboxFromResolverCache = true; if (teamMailbox.SharePointUrl != null && base.ExchangeRunspaceConfig != null) { TeamMailboxHelper teamMailboxHelper = new TeamMailboxHelper(teamMailbox, base.ExchangeRunspaceConfig.ExecutingUser, base.ExchangeRunspaceConfig.ExecutingUserOrganizationId, (IRecipientSession)base.DataSession, new TeamMailboxGetDataObject <ADUser>(base.GetDataObject <ADUser>)); try { teamMailboxHelper.LinkSharePointSite(null, false, false); } catch (RecipientTaskException ex) { this.WriteWarning(Strings.ErrorTeamMailFailedUnlinkSharePointSite(this.Identity.ToString(), teamMailbox.SharePointUrl.ToString(), ex.Message)); } } } return(adrecipient); }
protected override IConfigurable ResolveDataObject() { ADUser aduser = (ADUser)base.ResolveDataObject(); if (MailboxTaskHelper.ExcludeArbitrationMailbox(aduser, this.Arbitration) || MailboxTaskHelper.ExcludePublicFolderMailbox(aduser, this.PublicFolder) || MailboxTaskHelper.ExcludeMailboxPlan(aduser, false)) { base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(ADUser).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ErrorCategory.InvalidData, this.Identity); } if (base.Fields.IsModified(UserSchema.LinkedMasterAccount)) { aduser.MasterAccountSid = this.linkedUserSid; if (aduser.MasterAccountSid != null) { this.ResolveLinkedUser(aduser); } else { this.ResolveUnlinkedUser(aduser); } } return(aduser); }
protected override IConfigurable ResolveDataObject() { ADRecipient adrecipient = (ADRecipient)base.ResolveDataObject(); if (MailboxTaskHelper.ExcludeArbitrationMailbox(adrecipient, this.Arbitration) || MailboxTaskHelper.ExcludePublicFolderMailbox(adrecipient, this.PublicFolder) || MailboxTaskHelper.ExcludeMailboxPlan(adrecipient, true) || MailboxTaskHelper.ExcludeAuditLogMailbox(adrecipient, base.AuditLog)) { base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(ADUser).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ExchangeErrorCategory.Client, this.Identity); } return(adrecipient); }
protected override IConfigurable ResolveDataObject() { ADRecipient adrecipient = (ADRecipient)base.ResolveDataObject(); MailboxTaskHelper.BlockRemoveOrDisableIfLitigationHoldEnabled((ADUser)adrecipient, new Task.ErrorLoggerDelegate(base.WriteError), true, this.IgnoreLegalHold.ToBool()); MailboxTaskHelper.BlockRemoveOrDisableIfDiscoveryHoldEnabled((ADUser)adrecipient, new Task.ErrorLoggerDelegate(base.WriteError), true, this.IgnoreLegalHold.ToBool()); MailboxTaskHelper.BlockRemoveOrDisableIfJournalNDRMailbox((ADUser)adrecipient, this.TenantLocalConfigurationSession, new Task.ErrorLoggerDelegate(base.WriteError), true); MailboxTaskHelper.ValidateNoOABsAssignedToArbitrationMailbox((ADUser)adrecipient, this.DisableArbitrationMailboxWithOABsAllowed.ToBool(), new Task.ErrorLoggerDelegate(base.WriteError), Strings.ErrorDisableArbitrationMailboxWithOABsAssigned(this.Identity.ToString())); if (MailboxTaskHelper.ExcludeArbitrationMailbox(adrecipient, this.Arbitration) || MailboxTaskHelper.ExcludePublicFolderMailbox(adrecipient, this.PublicFolder) || MailboxTaskHelper.ExcludeMailboxPlan(adrecipient, false)) { base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(ADUser).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ErrorCategory.InvalidData, this.Identity); } if (ComplianceConfigImpl.JournalArchivingHardeningEnabled) { MailboxTaskHelper.BlockRemoveOrDisableMailboxIfJournalArchiveEnabled(base.DataSession as IRecipientSession, this.ConfigurationSession, (ADUser)adrecipient, new Task.ErrorLoggerDelegate(base.WriteError), true); } return(adrecipient); }