diff --git a/PowerShell/ScubaGear/Modules/CreateReport/CreateReport.psm1 b/PowerShell/ScubaGear/Modules/CreateReport/CreateReport.psm1
index 06dd3d2e7f..274bf4b034 100644
--- a/PowerShell/ScubaGear/Modules/CreateReport/CreateReport.psm1
+++ b/PowerShell/ScubaGear/Modules/CreateReport/CreateReport.psm1
@@ -270,13 +270,33 @@ function New-Report {
# Create a section header for the licensing information
$LicensingHTML = "
Tenant Licensing Information
" + $LicenseTable
+ # Create a section for privileged service principals
+ $privilegedServicePrincipalsTable = $SettingsExport.privileged_service_principals.psobject.properties | ForEach-Object {
+ $principal = $_.Value
+ [pscustomobject]@{
+ "Display Name" = $principal.DisplayName
+ "Service Principal ID" = $principal.ServicePrincipalId
+ "Roles" = ($principal.roles -join ", ")
+ "App ID" = $principal.AppId
+
+ }
+ } | ConvertTo-Html -Fragment
+
+ $privilegedServicePrincipalsTable = $privilegedServicePrincipalsTable -replace '^(.*?)', ''
+
+ # Create a section header for the service principal information
+ $privilegedServicePrincipalsTableHTML = "Privileged Service Principal Table
" + $privilegedServicePrincipalsTable
+
+
$ReportHTML = $ReportHTML.Replace("{AADWARNING}", $AADWarning)
$ReportHTML = $ReportHTML.Replace("{LICENSING_INFO}", $LicensingHTML)
+ $ReportHTML = $ReportHTML.Replace("{SERVICE_PRINCIPAL}", $privilegedServicePrincipalsTableHTML)
$CapJson = ConvertTo-Json $SettingsExport.cap_table_data
}
else {
$ReportHTML = $ReportHTML.Replace("{AADWARNING}", $NoWarning)
$ReportHTML = $ReportHTML.Replace("{LICENSING_INFO}", "")
+ $ReportHTML = $ReportHTML.Replace("{SERVICE_PRINCIPAL}", "")
$CapJson = "null"
}
diff --git a/PowerShell/ScubaGear/Modules/CreateReport/IndividualReport/IndividualReport.html b/PowerShell/ScubaGear/Modules/CreateReport/IndividualReport/IndividualReport.html
index df97a34cf1..e43d33ecb4 100644
--- a/PowerShell/ScubaGear/Modules/CreateReport/IndividualReport/IndividualReport.html
+++ b/PowerShell/ScubaGear/Modules/CreateReport/IndividualReport/IndividualReport.html
@@ -26,6 +26,7 @@ {TITLE}
{AADWARNING}
{TABLES}
{LICENSING_INFO}
+ {SERVICE_PRINCIPAL}