protected override IConfigDataProvider CreateSession()
        {
            base.SessionSettings.IncludeSoftDeletedObjectLinks = true;
            this.globalCatalogRBACSession = DistributionGroupMemberTaskBase <RecipientIdParameter> .CreateGlobalCatalogRBACSession(base.DomainController, base.SessionSettings);

            return(base.CreateSession());
        }
        protected override IConfigDataProvider CreateSession()
        {
            this.globalCatalogRBACSession = DistributionGroupMemberTaskBase <TMemberIdentity> .CreateGlobalCatalogRBACSession(base.DomainController, base.SessionSettings);

            IDirectorySession directorySession = (IDirectorySession)base.CreateSession();

            directorySession.ExclusiveLdapAttributes = DistributionGroupMemberTaskBase <TMemberIdentity> .exclusiveLdapAttributes;
            return((IConfigDataProvider)directorySession);
        }
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (base.DataObject.RecipientTypeDetails == RecipientTypeDetails.GroupMailbox || base.DataObject.RecipientTypeDetails == RecipientTypeDetails.RemoteGroupMailbox)
     {
         base.WriteError(new RecipientTaskException(Strings.NotAValidDistributionGroup), ExchangeErrorCategory.Client, this.Identity.ToString());
     }
     DistributionGroupMemberTaskBase <DistributionGroupIdParameter> .GetExecutingUserAndCheckGroupOwnership(this, (IDirectorySession)base.DataSession, base.TenantGlobalCatalogSession, base.DataObject, this.BypassSecurityGroupManagerCheck);
 }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            this.approvalRequired = false;
            this.requester        = null;
            base.InternalValidate();
            if (base.HasErrors)
            {
                return;
            }
            ADObjectId executingUserAndCheckGroupOwnership = DistributionGroupMemberTaskBase <TMemberIdentity> .GetExecutingUserAndCheckGroupOwnership(this, (IDirectorySession)base.DataSession, base.TenantGlobalCatalogSession, this.DataObject, this.BypassSecurityGroupManagerCheck);

            if (base.Fields.IsModified("Member"))
            {
                this.isSelfMemberAction = false;
                this.PerformGroupMemberAction();
            }
            else
            {
                if (executingUserAndCheckGroupOwnership == null)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorCannotDetermineRequester), ErrorCategory.InvalidArgument, this.DataObject.Identity);
                }
                this.Member    = this.IdentityFactory(executingUserAndCheckGroupOwnership);
                this.requester = (ADRecipient)base.GetDataObject <ADRecipient>(this.Member, base.TenantGlobalCatalogSession, this.DataObject.OrganizationId.OrganizationalUnit, new LocalizedString?(Strings.ErrorRecipientNotFound(executingUserAndCheckGroupOwnership.ToString())), new LocalizedString?(Strings.ErrorRecipientNotUnique(executingUserAndCheckGroupOwnership.ToString())));
                if (this.MemberUpdateRestriction == MemberUpdateType.Open || (this.DataObject.ManagedBy != null && this.DataObject.ManagedBy.Contains(this.requester.Id)) || this.IsExecutingUserGroupAdmin())
                {
                    this.PerformGroupMemberAction();
                }
                else
                {
                    switch (this.MemberUpdateRestriction)
                    {
                    case MemberUpdateType.Closed:
                        this.WriteClosedUpdateError();
                        break;

                    case MemberUpdateType.ApprovalRequired:
                        this.approvalRequired = true;
                        break;
                    }
                    this.GroupMemberCheck(this.requester);
                }
            }
            TaskLogger.LogExit();
        }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            if (this.DataObject.RecipientTypeDetails == RecipientTypeDetails.GroupMailbox || this.DataObject.RecipientTypeDetails == RecipientTypeDetails.RemoteGroupMailbox)
            {
                base.WriteError(new RecipientTaskException(Strings.NotAValidDistributionGroup), ExchangeErrorCategory.Client, this.Identity.ToString());
            }
            if (base.HasErrors)
            {
                return;
            }
            if (base.Fields.IsModified("Members"))
            {
                DistributionGroupMemberTaskBase <DistributionGroupIdParameter> .GetExecutingUserAndCheckGroupOwnership(this, (IDirectorySession)base.DataSession, base.TenantGlobalCatalogSession, this.DataObject, this.BypassSecurityGroupManagerCheck);

                MultiValuedProperty <ADObjectId> multiValuedProperty = new MultiValuedProperty <ADObjectId>();
                foreach (ADObjectId adobjectId in this.DataObject.Members)
                {
                    if (-1 != adobjectId.DistinguishedName.IndexOf(",OU=Soft Deleted Objects,", StringComparison.OrdinalIgnoreCase))
                    {
                        multiValuedProperty.Add(adobjectId);
                    }
                }
                this.DataObject.Members = multiValuedProperty;
                this.DataObject.Members.IsCompletelyRead = true;
                if (this.Members != null && this.Members.Count > 0)
                {
                    foreach (RecipientWithAdUserGroupIdParameter <RecipientIdParameter> member in this.Members)
                    {
                        MailboxTaskHelper.ValidateAndAddMember(base.TenantGlobalCatalogSession, this.DataObject, member, false, new Task.ErrorLoggerDelegate(base.WriteError), new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>));
                    }
                }
            }
            TaskLogger.LogExit();
        }