diff --git a/source/Private/Get-CISMSTeamsOutput.ps1 b/source/Private/Get-CISMSTeamsOutput.ps1 index 81f055d..39a95f3 100644 --- a/source/Private/Get-CISMSTeamsOutput.ps1 +++ b/source/Private/Get-CISMSTeamsOutput.ps1 @@ -163,9 +163,13 @@ function Get-CISMSTeamsOutput { # - Condition A: The `AllowAnonymousUsersToStartMeeting` setting in the Teams admin center is not set to `False`. # - 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 = [PSCustomObject]@{ + AllowAnonymousUsersToStartMeeting = $true + } + #> # Retrieve the Teams meeting policy for the global scope and check if anonymous users can start meetings $CsTeamsMeetingPolicyAnonymous = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property AllowAnonymousUsersToStartMeeting return $CsTeamsMeetingPolicyAnonymous diff --git a/source/tests/Test-NoAnonymousMeetingStart.ps1 b/source/tests/Test-NoAnonymousMeetingStart.ps1 index 424e756..f1ea675 100644 --- a/source/tests/Test-NoAnonymousMeetingStart.ps1 +++ b/source/tests/Test-NoAnonymousMeetingStart.ps1 @@ -5,14 +5,12 @@ function Test-NoAnonymousMeetingStart { # Aligned # Parameters can be defined here if needed ) - begin { # Dot source the class script if necessary #. .\source\Classes\CISAuditResult.ps1 # Initialization code, if needed $recnum = "8.5.2" } - process { try { # 8.5.2 (L1) Ensure anonymous users and dial-in callers can't start a meeting @@ -30,13 +28,10 @@ function Test-NoAnonymousMeetingStart { # - Condition A: The `AllowAnonymousUsersToStartMeeting` setting in the Teams admin center is not set to `False`. # - 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 - # Retrieve the Teams meeting policy for the global scope and check if anonymous users can start meetings $CsTeamsMeetingPolicyAnonymous = Get-CISMSTeamsOutput -Rec $recnum $anonymousStartDisabled = -not $CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting - # Prepare failure reasons and details based on compliance $failureReasons = if ($anonymousStartDisabled) { "N/A" @@ -44,9 +39,7 @@ function Test-NoAnonymousMeetingStart { else { "Anonymous users and dial-in callers can start a meeting" # Condition A and B } - $details = "AllowAnonymousUsersToStartMeeting is set to $($CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting)" # Condition C - # Create and populate the CISAuditResult object $params = @{ Rec = $recnum @@ -62,7 +55,6 @@ function Test-NoAnonymousMeetingStart { $auditResult = Get-TestError -LastError $LastError -recnum $recnum } } - end { # Return the audit result return $auditResult