protected override IConfigurable PrepareDataObject() { base.PrepareDataObject(); if (this.Cmdlets != null) { this.DataObject.Cmdlets = this.Cmdlets; } if (this.Parameters != null) { this.DataObject.Parameters = this.Parameters; } if (this.ObjectIds != null) { this.DataObject.ObjectIds = this.ObjectIds; } if (this.UserIds != null) { this.DataObject.UserIdsUserInput = this.UserIds; } this.DataObject.Succeeded = null; this.DataObject.StartIndex = 0; this.DataObject.ResultSize = 50000; this.DataObject.RedactDatacenterAdmins = !AdminAuditExternalAccessDeterminer.IsExternalAccess(base.SessionSettings.ExecutingUserIdentityName, base.SessionSettings.ExecutingUserOrganizationId, base.SessionSettings.CurrentOrganizationId); AdminAuditLogHelper.SetResolveUsers(this.DataObject, new DataAccessHelper.GetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); this.DataObject.Validate(new Task.TaskErrorLoggingDelegate(base.WriteError)); return(this.DataObject); }
protected override void InternalValidate() { if (this.StartDate == null && this.EndDate == null) { this.EndDate = new ExDateTime?(ExDateTime.Now); this.StartDate = new ExDateTime?(this.EndDate.Value.AddDays(-15.0)); } if (this.StartDate != null && this.EndDate == null) { this.EndDate = new ExDateTime?(this.StartDate.Value.AddDays(15.0)); } if (this.StartDate == null && this.EndDate != null) { this.StartDate = new ExDateTime?(this.EndDate.Value.AddDays(-15.0)); } if (this.StartDate.Value > this.EndDate.Value) { base.WriteError(new ArgumentException(Strings.AdminAuditLogSearchStartDateIsLaterThanEndDate(this.StartDate.Value.ToString(), this.EndDate.Value.ToString())), ErrorCategory.InvalidArgument, null); } if (base.Fields["ResultSize"] == null) { this.ResultSize = 1000; } int num = 250000; if (base.Fields["StartIndex"] == null) { this.StartIndex = 0; } if (this.StartIndex < 0 || this.StartIndex > num) { base.WriteError(new ArgumentOutOfRangeException("StartIndex", this.StartIndex, Strings.AdminAuditLogSearchOutOfRangeStartIndex(num)), ErrorCategory.InvalidArgument, null); } this.searchObject = new AdminAuditLogSearch { OrganizationId = base.CurrentOrganizationId, Cmdlets = this.Cmdlets, Parameters = this.Parameters, ObjectIds = this.ObjectIds, UserIdsUserInput = this.UserIds, Succeeded = this.IsSuccess, StartIndex = this.StartIndex, ExternalAccess = this.ExternalAccess, ResultSize = this.ResultSize, RedactDatacenterAdmins = !AdminAuditExternalAccessDeterminer.IsExternalAccess(base.SessionSettings.ExecutingUserIdentityName, base.SessionSettings.ExecutingUserOrganizationId, base.SessionSettings.CurrentOrganizationId) }; if (!this.StartDate.Value.HasTimeZone) { ExDateTime exDateTime = ExDateTime.Create(ExTimeZone.CurrentTimeZone, this.StartDate.Value.UniversalTime)[0]; this.searchObject.StartDateUtc = new DateTime?(exDateTime.UniversalTime); } else { this.searchObject.StartDateUtc = new DateTime?(this.StartDate.Value.UniversalTime); } if (!this.EndDate.Value.HasTimeZone) { ExDateTime exDateTime2 = ExDateTime.Create(ExTimeZone.CurrentTimeZone, this.EndDate.Value.UniversalTime)[0]; this.searchObject.EndDateUtc = new DateTime?(exDateTime2.UniversalTime); } else { this.searchObject.EndDateUtc = new DateTime?(this.EndDate.Value.UniversalTime); } AdminAuditLogHelper.SetResolveUsers(this.searchObject, new DataAccessHelper.GetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); this.searchObject.Validate(new Task.TaskErrorLoggingDelegate(base.WriteError)); base.InternalValidate(); }