From 540fe11ce97a870459e932b7451ca778aa8f0df8 Mon Sep 17 00:00:00 2001 From: DrIOS <58635327+DrIOSX@users.noreply.github.com> Date: Sun, 30 Jun 2024 11:46:53 -0500 Subject: [PATCH] fix: 8.5.3 simplified output and added object comment --- source/Private/Get-CISMSTeamsOutput.ps1 | 10 +++++++--- source/tests/Test-OrgOnlyBypassLobby.ps1 | 8 +------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/Private/Get-CISMSTeamsOutput.ps1 b/source/Private/Get-CISMSTeamsOutput.ps1 index 39a95f3..1423c71 100644 --- a/source/Private/Get-CISMSTeamsOutput.ps1 +++ b/source/Private/Get-CISMSTeamsOutput.ps1 @@ -164,7 +164,7 @@ function Get-CISMSTeamsOutput { # - Condition B: The setting for anonymous users and dial-in callers starting a meeting allows them to bypass the lobby. # - Condition C: Verification using the UI indicates that the setting `Anonymous users and dial-in callers can start a meeting` is not set to `Off`. # Connect to Teams PowerShell using Connect-MicrosoftTeams - # $teamsMeetingPolicy Mock Object + # $CsTeamsMeetingPolicyAnonymous Mock Object <# $CsTeamsMeetingPolicyAnonymous = [PSCustomObject]@{ AllowAnonymousUsersToStartMeeting = $true @@ -191,10 +191,14 @@ function Get-CISMSTeamsOutput { # - Condition A: The `AutoAdmittedUsers` setting in the Teams meeting policy is not set to `EveryoneInCompanyExcludingGuests`. # - Condition B: The setting for "Who can bypass the lobby" is not configured to "People in my org" using the UI. # - Condition C: Verification using the Microsoft Teams admin center indicates that the meeting join & lobby settings are not configured as recommended. - # Connect to Teams PowerShell using Connect-MicrosoftTeams - # Retrieve the Teams meeting policy for lobby bypass settings + # $CsTeamsMeetingPolicyLobby Mock Object + <# + $CsTeamsMeetingPolicyLobby = [PSCustomObject]@{ + AutoAdmittedUsers = "OrganizerOnly" + } + #> $CsTeamsMeetingPolicyLobby = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property AutoAdmittedUsers return $CsTeamsMeetingPolicyLobby } diff --git a/source/tests/Test-OrgOnlyBypassLobby.ps1 b/source/tests/Test-OrgOnlyBypassLobby.ps1 index 2f6f208..785a85e 100644 --- a/source/tests/Test-OrgOnlyBypassLobby.ps1 +++ b/source/tests/Test-OrgOnlyBypassLobby.ps1 @@ -30,28 +30,23 @@ function Test-OrgOnlyBypassLobby { # - Condition A: The `AutoAdmittedUsers` setting in the Teams meeting policy is not set to `EveryoneInCompanyExcludingGuests`. # - Condition B: The setting for "Who can bypass the lobby" is not configured to "People in my org" using the UI. # - Condition C: Verification using the Microsoft Teams admin center indicates that the meeting join & lobby settings are not configured as recommended. - # Connect to Teams PowerShell using Connect-MicrosoftTeams - # Retrieve the Teams meeting policy for lobby bypass settings $CsTeamsMeetingPolicyLobby = Get-CISMSTeamsOutput -Rec $recnum $lobbyBypassRestricted = $CsTeamsMeetingPolicyLobby.AutoAdmittedUsers -eq 'EveryoneInCompanyExcludingGuests' - # Prepare failure reasons and details based on compliance $failureReasons = if (-not $lobbyBypassRestricted) { # Condition C: Verification using the Microsoft Teams admin center indicates that the meeting join & lobby settings are not configured as recommended. "AutoAdmittedUsers is set to $($CsTeamsMeetingPolicyLobby.AutoAdmittedUsers)" - }else { "N/A" } - $details = if ($lobbyBypassRestricted) { # Condition B: The setting for "Who can bypass the lobby" is configured to "People in my org" using the UI. "Only people in the organization can bypass the lobby." }else { # Condition A: The `AutoAdmittedUsers` setting in the Teams meeting policy is not set to `EveryoneInCompanyExcludingGuests`. - "External participants can bypass the lobby" + "AutoAdmittedUsers is not set to EveryoneInCompanyExcludingGuests" } # Create and populate the CISAuditResult object $params = @{ @@ -68,7 +63,6 @@ function Test-OrgOnlyBypassLobby { $auditResult = Get-TestError -LastError $LastError -recnum $recnum } } - end { # Return the audit result return $auditResult