fix: 1.2.2 simplified output and added object comment
This commit is contained in:
@@ -52,7 +52,11 @@ function Get-CISExoOutput {
|
||||
# Test-BlockSharedMailboxSignIn.ps1
|
||||
$MBX = Get-EXOMailbox -RecipientTypeDetails SharedMailbox
|
||||
# [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' {
|
||||
# Test-ExternalSharingCalendars.ps1
|
||||
|
@@ -30,8 +30,7 @@ function Test-BlockSharedMailboxSignIn {
|
||||
process {
|
||||
try {
|
||||
# Step: Retrieve shared mailbox details
|
||||
$MBX = Get-CISExoOutput -Rec $recnum
|
||||
$objectids = $MBX.ExternalDirectoryObjectId
|
||||
$objectids = Get-CISExoOutput -Rec $recnum
|
||||
$users = Get-CISAadOutput -Rec $recnum
|
||||
# Step: Retrieve details of shared mailboxes from Azure AD (Condition B: Pass/Fail)
|
||||
$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)
|
||||
$failureReasons = if (-not $allBlocked) {
|
||||
"Some mailboxes have sign-in enabled: $($enabledMailboxes -join ', ')"
|
||||
"Some mailboxes have sign-in enabled (AccountEnabled:True):`n$($enabledMailboxes -join ', ')"
|
||||
}
|
||||
else {
|
||||
"N/A"
|
||||
@@ -53,7 +52,7 @@ function Test-BlockSharedMailboxSignIn {
|
||||
"All shared mailboxes have sign-in blocked."
|
||||
}
|
||||
else {
|
||||
"Enabled Mailboxes: $($enabledMailboxes -join ', ')"
|
||||
"AccountEnabled set to True Mailboxes: $($enabledMailboxes -join ', ')"
|
||||
}
|
||||
|
||||
# Step: Create and populate the CISAuditResult object
|
||||
|
Reference in New Issue
Block a user