public PowerShellResults <AdminAuditLogDetailRow> GetObject(Identity identity) { PowerShellResults <AdminAuditLogDetailRow> powerShellResults = new PowerShellResults <AdminAuditLogDetailRow>(); if (identity != null && identity.RawIdentity != null) { AuditLogDetailsId auditLogDetailsId = new AuditLogDetailsId(identity); AdminAuditLogSearchFilter adminAuditLogSearchFilter = new AdminAuditLogSearchFilter(); adminAuditLogSearchFilter.Cmdlets = "Set-Mailbox"; adminAuditLogSearchFilter.Parameters = "LitigationHoldEnabled"; if (auditLogDetailsId.StartDate != "NoStart") { adminAuditLogSearchFilter.StartDate = auditLogDetailsId.StartDate; } if (auditLogDetailsId.EndDate != "NoEnd") { adminAuditLogSearchFilter.EndDate = auditLogDetailsId.EndDate; } PSCommand pscommand = new PSCommand().AddCommand("Search-AdminAuditLog").AddParameters(adminAuditLogSearchFilter); pscommand.AddParameter("objectIds", auditLogDetailsId.Object); pscommand.AddParameter("resultSize", 501); PowerShellResults <AdminAuditLogEvent> powerShellResults2 = base.Invoke <AdminAuditLogEvent>(pscommand); if (powerShellResults2.Succeeded) { if (powerShellResults2.Output.Length == 501) { powerShellResults.Warnings = new string[] { Strings.TooManyAuditLogsInDetailsPane }; } AdminAuditLogDetailRow[] array = new AdminAuditLogDetailRow[powerShellResults2.Output.Length]; for (int i = 0; i < powerShellResults2.Output.Length; i++) { array[i] = new AdminAuditLogDetailRow(identity, powerShellResults2.Output[i]); } powerShellResults.MergeOutput(array); } powerShellResults.MergeErrors <AdminAuditLogEvent>(powerShellResults2); } return(powerShellResults); }
public PowerShellResults <AdminAuditLogDetailRow> GetObject(Identity identity) { AuditLogDetailsId auditLogDetailsId = new AuditLogDetailsId(identity); AdminAuditLogSearchFilter adminAuditLogSearchFilter = new AdminAuditLogSearchFilter(); adminAuditLogSearchFilter.Cmdlets = "Add-RoleGroupMember,Remove-RoleGroupMember,Update-RoleGroupMember,New-RoleGroup,Remove-RoleGroup"; if (auditLogDetailsId.StartDate != "NoStart") { adminAuditLogSearchFilter.StartDate = auditLogDetailsId.StartDate; } if (auditLogDetailsId.EndDate != "NoEnd") { adminAuditLogSearchFilter.EndDate = auditLogDetailsId.EndDate; } adminAuditLogSearchFilter.ObjectIds = auditLogDetailsId.Object; PSCommand pscommand = new PSCommand().AddCommand("Search-AdminAuditLog").AddParameters(adminAuditLogSearchFilter); pscommand.AddParameter("resultSize", 501); PowerShellResults <AdminAuditLogEvent> powerShellResults = base.Invoke <AdminAuditLogEvent>(pscommand); PowerShellResults <AdminAuditLogDetailRow> powerShellResults2 = new PowerShellResults <AdminAuditLogDetailRow>(); if (powerShellResults.Succeeded) { if (powerShellResults.Output.Length == 501) { powerShellResults2.Warnings = new string[] { Strings.TooManyAuditLogsInDetailsPane }; } List <AdminAuditLogDetailRow> list = new List <AdminAuditLogDetailRow>(); for (int i = 0; i < powerShellResults.Output.Length; i++) { list.Add(new AdminAuditLogDetailRow(identity, auditLogDetailsId.Object, powerShellResults.Output[i])); } powerShellResults2.MergeOutput(list.ToArray()); return(powerShellResults2); } powerShellResults2.MergeErrors <AdminAuditLogEvent>(powerShellResults); return(powerShellResults2); }
public PowerShellResults <AdminAuditLogDetailRow> GetObject(Identity identity) { PowerShellResults <AdminAuditLogDetailRow> powerShellResults = new PowerShellResults <AdminAuditLogDetailRow>(); if (identity != null && identity.RawIdentity != null) { AuditLogDetailsId changeId = new AuditLogDetailsId(identity); AdminAuditLogSearchFilter adminAuditLogSearchFilter = new AdminAuditLogSearchFilter(); adminAuditLogSearchFilter.Cmdlets = "New-MailboxSearch, Start-MailboxSearch, Get-MailboxSearch, Stop-MailboxSearch, Remove-MailboxSearch, Set-MailboxSearch"; adminAuditLogSearchFilter.Parameters = "*"; if (changeId.StartDate != "NoStart") { adminAuditLogSearchFilter.StartDate = changeId.StartDate; } if (changeId.EndDate != "NoEnd") { adminAuditLogSearchFilter.EndDate = changeId.EndDate; } PSCommand pscommand = new PSCommand().AddCommand("Search-AdminAuditLog").AddParameters(adminAuditLogSearchFilter); pscommand.AddParameter("resultSize", 501); PowerShellResults <AdminAuditLogEvent> powerShellResults2 = base.Invoke <AdminAuditLogEvent>(pscommand); if (powerShellResults2.Succeeded) { if (powerShellResults2.Output.Length == 501) { powerShellResults.Warnings = new string[] { Strings.TooManyAuditLogsInDetailsPane }; } powerShellResults.MergeOutput((from x in powerShellResults2.Output where x.SearchObject == changeId.Object select new AdminAuditLogDetailRow(identity, x)).ToArray <AdminAuditLogDetailRow>()); } powerShellResults.MergeErrors <AdminAuditLogEvent>(powerShellResults2); } return(powerShellResults); }