fix: 1.2.2 simplified output and added object comment

This commit is contained in:
DrIOS
2024-06-28 17:32:11 -05:00
parent 8ce1af7745
commit c652b3c886
2 changed files with 8 additions and 5 deletions

View File

@@ -52,7 +52,11 @@ function Get-CISExoOutput {
# Test-BlockSharedMailboxSignIn.ps1 # Test-BlockSharedMailboxSignIn.ps1
$MBX = Get-EXOMailbox -RecipientTypeDetails SharedMailbox $MBX = Get-EXOMailbox -RecipientTypeDetails SharedMailbox
# [object[]] # [object[]]
return $MBX # Example output:
# 123e4567-e89b-12d3-a456-426614174000
# 987e6543-21ba-12d3-a456-426614174000
# abcddcba-98fe-76dc-a456-426614174000
return $MBX.ExternalDirectoryObjectId
} }
'1.3.3' { '1.3.3' {
# Test-ExternalSharingCalendars.ps1 # Test-ExternalSharingCalendars.ps1

View File

@@ -30,8 +30,7 @@ function Test-BlockSharedMailboxSignIn {
process { process {
try { try {
# Step: Retrieve shared mailbox details # Step: Retrieve shared mailbox details
$MBX = Get-CISExoOutput -Rec $recnum $objectids = Get-CISExoOutput -Rec $recnum
$objectids = $MBX.ExternalDirectoryObjectId
$users = Get-CISAadOutput -Rec $recnum $users = Get-CISAadOutput -Rec $recnum
# Step: Retrieve details of shared mailboxes from Azure AD (Condition B: Pass/Fail) # Step: Retrieve details of shared mailboxes from Azure AD (Condition B: Pass/Fail)
$sharedMailboxDetails = $users | Where-Object {$_.objectid -in $objectids} $sharedMailboxDetails = $users | Where-Object {$_.objectid -in $objectids}
@@ -42,7 +41,7 @@ function Test-BlockSharedMailboxSignIn {
# Step: Determine failure reasons based on enabled mailboxes (Condition A & B: Fail) # Step: Determine failure reasons based on enabled mailboxes (Condition A & B: Fail)
$failureReasons = if (-not $allBlocked) { $failureReasons = if (-not $allBlocked) {
"Some mailboxes have sign-in enabled: $($enabledMailboxes -join ', ')" "Some mailboxes have sign-in enabled (AccountEnabled:True):`n$($enabledMailboxes -join ', ')"
} }
else { else {
"N/A" "N/A"
@@ -53,7 +52,7 @@ function Test-BlockSharedMailboxSignIn {
"All shared mailboxes have sign-in blocked." "All shared mailboxes have sign-in blocked."
} }
else { else {
"Enabled Mailboxes: $($enabledMailboxes -join ', ')" "AccountEnabled set to True Mailboxes: $($enabledMailboxes -join ', ')"
} }
# Step: Create and populate the CISAuditResult object # Step: Create and populate the CISAuditResult object