fix: 8.5.5 simplified output and added object comment
This commit is contained in:
@@ -246,8 +246,13 @@ function Get-CISMSTeamsOutput {
|
|||||||
# - Condition A: The `MeetingChatEnabledType` setting in Teams is not set to `EnabledExceptAnonymous`.
|
# - Condition A: The `MeetingChatEnabledType` setting in Teams is not set to `EnabledExceptAnonymous`.
|
||||||
# - Condition B: The setting for meeting chat allows chat for anonymous users.
|
# - Condition B: The setting for meeting chat allows chat for anonymous users.
|
||||||
# - Condition C: Verification using the Teams Admin Center indicates that the meeting chat settings are not configured as recommended.
|
# - Condition C: Verification using the Teams Admin Center indicates that the meeting chat settings are not configured as recommended.
|
||||||
|
|
||||||
# Retrieve the Teams meeting policy for meeting chat
|
# Retrieve the Teams meeting policy for meeting chat
|
||||||
|
# $CsTeamsMeetingPolicyChat Mock Object
|
||||||
|
<#
|
||||||
|
$CsTeamsMeetingPolicyChat = [PSCustomObject]@{
|
||||||
|
MeetingChatEnabledType = "Enabled"
|
||||||
|
}
|
||||||
|
#>
|
||||||
$CsTeamsMeetingPolicyChat = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property MeetingChatEnabledType
|
$CsTeamsMeetingPolicyChat = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property MeetingChatEnabledType
|
||||||
return $CsTeamsMeetingPolicyChat
|
return $CsTeamsMeetingPolicyChat
|
||||||
}
|
}
|
||||||
|
@@ -5,14 +5,12 @@ function Test-MeetingChatNoAnonymous {
|
|||||||
# 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.5"
|
$recnum = "8.5.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
try {
|
try {
|
||||||
# 8.5.5 (L2) Ensure meeting chat does not allow anonymous users
|
# 8.5.5 (L2) Ensure meeting chat does not allow anonymous users
|
||||||
@@ -30,22 +28,24 @@ function Test-MeetingChatNoAnonymous {
|
|||||||
# - Condition A: The `MeetingChatEnabledType` setting in Teams is not set to `EnabledExceptAnonymous`.
|
# - Condition A: The `MeetingChatEnabledType` setting in Teams is not set to `EnabledExceptAnonymous`.
|
||||||
# - Condition B: The setting for meeting chat allows chat for anonymous users.
|
# - Condition B: The setting for meeting chat allows chat for anonymous users.
|
||||||
# - Condition C: Verification using the Teams Admin Center indicates that the meeting chat settings are not configured as recommended.
|
# - Condition C: Verification using the Teams Admin Center indicates that the meeting chat settings are not configured as recommended.
|
||||||
|
|
||||||
# Retrieve the Teams meeting policy for meeting chat
|
# Retrieve the Teams meeting policy for meeting chat
|
||||||
|
# $CsTeamsMeetingPolicyChat Mock Object
|
||||||
|
<#
|
||||||
|
$CsTeamsMeetingPolicyChat = [PSCustomObject]@{
|
||||||
|
MeetingChatEnabledType = "Enabled"
|
||||||
|
}
|
||||||
|
#>
|
||||||
$CsTeamsMeetingPolicyChat = Get-CISMSTeamsOutput -Rec $recnum
|
$CsTeamsMeetingPolicyChat = Get-CISMSTeamsOutput -Rec $recnum
|
||||||
# Condition A: Check if the MeetingChatEnabledType is set to 'EnabledExceptAnonymous'
|
# Condition A: Check if the MeetingChatEnabledType is set to 'EnabledExceptAnonymous'
|
||||||
$chatAnonDisabled = $CsTeamsMeetingPolicyChat.MeetingChatEnabledType -eq 'EnabledExceptAnonymous'
|
$chatAnonDisabled = $CsTeamsMeetingPolicyChat.MeetingChatEnabledType -eq 'EnabledExceptAnonymous'
|
||||||
|
|
||||||
# Prepare failure reasons and details based on compliance
|
# Prepare failure reasons and details based on compliance
|
||||||
$failureReasons = if ($chatAnonDisabled) {
|
$failureReasons = if ($chatAnonDisabled) {
|
||||||
"N/A"
|
"N/A"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
"Meeting chat allows anonymous users"
|
"Meeting chat allows anonymous users. User the following command to remediate:`nSet-CsTeamsMeetingPolicy -Identity Global -MeetingChatEnabledType `"EnabledExceptAnonymous`""
|
||||||
}
|
}
|
||||||
|
|
||||||
$details = "MeetingChatEnabledType is set to $($CsTeamsMeetingPolicyChat.MeetingChatEnabledType)"
|
$details = "MeetingChatEnabledType is set to $($CsTeamsMeetingPolicyChat.MeetingChatEnabledType)"
|
||||||
|
|
||||||
# Create and populate the CISAuditResult object
|
# Create and populate the CISAuditResult object
|
||||||
$params = @{
|
$params = @{
|
||||||
Rec = $recnum
|
Rec = $recnum
|
||||||
@@ -61,7 +61,6 @@ function Test-MeetingChatNoAnonymous {
|
|||||||
$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