Skip to content

Commit 08ddf3f

Browse files
Do not render User authentication and Device sign-ins charts when Sig… (#1062)
1 parent a17e21f commit 08ddf3f

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

src/powershell/assets/ReportTemplate.html

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

src/powershell/private/tenantinfo/Add-ZtOverviewCaDevicesAllUsers.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ group by isManaged, isCompliant
8181

8282

8383
$results = Invoke-DatabaseQuery -Database $Database -Sql $sql
84+
# Handle if SignIn table doesn't exist or is empty
85+
if ($null -eq $results -or $results.Count -eq 0) {
86+
Write-PSFMessage "SignIn table is empty or doesn't exist" -Tag Test -Level VeryVerbose
87+
Add-ZtTenantInfo -Name $tenantInfoName -Value $null
88+
return
89+
}
8490

8591
$caSummary = Get-ZtiOverviewCaDevicesAllUsers -Results $results -Database $Database
8692

src/powershell/private/tenantinfo/Add-ZtOverviewCaMfa.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<#
32
.SYNOPSIS
43
Calculates the CA summary data from sign in logs for the overiew report and adds it to the tenant info.
@@ -85,6 +84,13 @@ group by conditionalAccessStatus, authenticationRequirement
8584

8685

8786
$results = Invoke-DatabaseQuery -Database $Database -Sql $sql
87+
# Handle if SignIn table doesn't exist or is empty
88+
if ($null -eq $results -or $results.Count -eq 0) {
89+
Write-PSFMessage "SignIn table is empty or doesn't exist." -Tag Test -Level VeryVerbose
90+
Add-ZtTenantInfo -Name $tenantInfoName -Value $null
91+
return
92+
}
93+
8894
$caSummary = Get-ZtiOverviewCaMfa -Results $results -Database $Database
8995
Add-ZtTenantInfo -Name $tenantInfoName -Value $caSummary
9096
}

0 commit comments

Comments
 (0)