Skip to content

Commit 1243b3e

Browse files
author
user
committed
More verbose logging around Get-MgBetaSecurityAuditLogQueryRecord. Bump version
1 parent fe507ae commit 1243b3e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

DFIR-O365RC/DFIR-O365RC.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
RootModule = '.\DFIR-O365RC.psm1'
88

99
# Version number of this module.
10-
ModuleVersion = '2.0.4'
10+
ModuleVersion = '2.0.5'
1111

1212
# Supported PSEditions
1313
CompatiblePSEditions = 'Core', 'Desktop'

DFIR-O365RC/DFIR-O365RC.psm1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,9 @@ function Get-UnifiedAuditLogPurview {
893893
[Int]$retryCount = "0"
894894
do {
895895
try {
896+
"Trying to get events for query $auditLogQueryId" | Write-Log -LogPath $logFile -LogLevel "Info"
896897
$records = Get-MgBetaSecurityAuditLogQueryRecord -AuditLogQueryId $auditLogQueryId -All -ErrorAction Stop
898+
"Got events for query $auditLogQueryId" | Write-Log -LogPath $logFile -LogLevel "Info"
897899
$stopLoop = $true
898900
}
899901
catch {
@@ -972,7 +974,7 @@ function Get-MailboxAuditLog {
972974
$stopLoop = $true
973975
}
974976
catch {
975-
if ($_.ToString().contains("ManagementObjectNotFoundException")){
977+
if ($_.ToString().contains("ManagementObjectNotFoundException") -or $_.ToString().contains("couldn't be found on")){
976978
"$($userId) does not have a mailbox" | Write-Log -LogPath $logFile -LogLevel "Warning"
977979
$countMailboxAuditLogEntries = 0
978980
$stopLoop = $true

0 commit comments

Comments
 (0)