fix: 8.5.1 simplified output and added object comment
This commit is contained in:
@@ -163,9 +163,13 @@ function Get-CISMSTeamsOutput {
|
|||||||
# - Condition A: The `AllowAnonymousUsersToStartMeeting` setting in the Teams admin center is not set to `False`.
|
# - 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 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`.
|
# - 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
|
# 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
|
# 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
|
$CsTeamsMeetingPolicyAnonymous = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property AllowAnonymousUsersToStartMeeting
|
||||||
return $CsTeamsMeetingPolicyAnonymous
|
return $CsTeamsMeetingPolicyAnonymous
|
||||||
|
@@ -5,14 +5,12 @@ function Test-NoAnonymousMeetingStart {
|
|||||||
# Aligned
|
# Aligned
|
||||||
# Parameters can be defined here if needed
|
# Parameters can be defined here if needed
|
||||||
)
|
)
|
||||||
|
|
||||||
begin {
|
begin {
|
||||||
# Dot source the class script if necessary
|
# Dot source the class script if necessary
|
||||||
#. .\source\Classes\CISAuditResult.ps1
|
#. .\source\Classes\CISAuditResult.ps1
|
||||||
# Initialization code, if needed
|
# Initialization code, if needed
|
||||||
$recnum = "8.5.2"
|
$recnum = "8.5.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
try {
|
try {
|
||||||
# 8.5.2 (L1) Ensure anonymous users and dial-in callers can't start a meeting
|
# 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 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 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`.
|
# - 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
|
# Connect to Teams PowerShell using Connect-MicrosoftTeams
|
||||||
|
|
||||||
# Retrieve the Teams meeting policy for the global scope and check if anonymous users can start meetings
|
# Retrieve the Teams meeting policy for the global scope and check if anonymous users can start meetings
|
||||||
$CsTeamsMeetingPolicyAnonymous = Get-CISMSTeamsOutput -Rec $recnum
|
$CsTeamsMeetingPolicyAnonymous = Get-CISMSTeamsOutput -Rec $recnum
|
||||||
$anonymousStartDisabled = -not $CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting
|
$anonymousStartDisabled = -not $CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting
|
||||||
|
|
||||||
# Prepare failure reasons and details based on compliance
|
# Prepare failure reasons and details based on compliance
|
||||||
$failureReasons = if ($anonymousStartDisabled) {
|
$failureReasons = if ($anonymousStartDisabled) {
|
||||||
"N/A"
|
"N/A"
|
||||||
@@ -44,9 +39,7 @@ function Test-NoAnonymousMeetingStart {
|
|||||||
else {
|
else {
|
||||||
"Anonymous users and dial-in callers can start a meeting" # Condition A and B
|
"Anonymous users and dial-in callers can start a meeting" # Condition A and B
|
||||||
}
|
}
|
||||||
|
|
||||||
$details = "AllowAnonymousUsersToStartMeeting is set to $($CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting)" # Condition C
|
$details = "AllowAnonymousUsersToStartMeeting is set to $($CsTeamsMeetingPolicyAnonymous.AllowAnonymousUsersToStartMeeting)" # Condition C
|
||||||
|
|
||||||
# Create and populate the CISAuditResult object
|
# Create and populate the CISAuditResult object
|
||||||
$params = @{
|
$params = @{
|
||||||
Rec = $recnum
|
Rec = $recnum
|
||||||
@@ -62,7 +55,6 @@ function Test-NoAnonymousMeetingStart {
|
|||||||
$auditResult = Get-TestError -LastError $LastError -recnum $recnum
|
$auditResult = Get-TestError -LastError $LastError -recnum $recnum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end {
|
end {
|
||||||
# Return the audit result
|
# Return the audit result
|
||||||
return $auditResult
|
return $auditResult
|
||||||
|
Reference in New Issue
Block a user