fix: 8.5.6 simplified output and added object comment
This commit is contained in:
@@ -273,8 +273,13 @@ function Get-CISMSTeamsOutput {
|
|||||||
# - Condition A: The `DesignatedPresenterRoleMode` setting in the Teams meeting policy is not set to `OrganizerOnlyUserOverride`.
|
# - Condition A: The `DesignatedPresenterRoleMode` setting in the Teams meeting policy is not set to `OrganizerOnlyUserOverride`.
|
||||||
# - Condition B: Verification using the Teams admin center indicates that the setting "Who can present" is not configured to "Only organizers and co-organizers".
|
# - Condition B: Verification using the Teams admin center indicates that the setting "Who can present" is not configured to "Only organizers and co-organizers".
|
||||||
# - Condition C: Verification using PowerShell indicates that the `DesignatedPresenterRoleMode` is not set to `OrganizerOnlyUserOverride`.
|
# - Condition C: Verification using PowerShell indicates that the `DesignatedPresenterRoleMode` is not set to `OrganizerOnlyUserOverride`.
|
||||||
|
|
||||||
# Retrieve the Teams meeting policy for presenters
|
# Retrieve the Teams meeting policy for presenters
|
||||||
|
# $CsTeamsMeetingPolicyPresenters Mock Object
|
||||||
|
<#
|
||||||
|
$CsTeamsMeetingPolicyPresenters = [PSCustomObject]@{
|
||||||
|
DesignatedPresenterRoleMode = "Enabled"
|
||||||
|
}
|
||||||
|
#>
|
||||||
$CsTeamsMeetingPolicyPresenters = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property DesignatedPresenterRoleMode
|
$CsTeamsMeetingPolicyPresenters = Get-CsTeamsMeetingPolicy -Identity Global | Select-Object -Property DesignatedPresenterRoleMode
|
||||||
return $CsTeamsMeetingPolicyPresenters
|
return $CsTeamsMeetingPolicyPresenters
|
||||||
}
|
}
|
||||||
|
@@ -5,14 +5,12 @@ function Test-OrganizersPresent {
|
|||||||
# 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.6"
|
$recnum = "8.5.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
try {
|
try {
|
||||||
# 8.5.6 (L2) Ensure only organizers and co-organizers can present
|
# 8.5.6 (L2) Ensure only organizers and co-organizers can present
|
||||||
@@ -30,26 +28,28 @@ function Test-OrganizersPresent {
|
|||||||
# - Condition A: The `DesignatedPresenterRoleMode` setting in the Teams meeting policy is not set to `OrganizerOnlyUserOverride`.
|
# - Condition A: The `DesignatedPresenterRoleMode` setting in the Teams meeting policy is not set to `OrganizerOnlyUserOverride`.
|
||||||
# - Condition B: Verification using the Teams admin center indicates that the setting "Who can present" is not configured to "Only organizers and co-organizers".
|
# - Condition B: Verification using the Teams admin center indicates that the setting "Who can present" is not configured to "Only organizers and co-organizers".
|
||||||
# - Condition C: Verification using PowerShell indicates that the `DesignatedPresenterRoleMode` is not set to `OrganizerOnlyUserOverride`.
|
# - Condition C: Verification using PowerShell indicates that the `DesignatedPresenterRoleMode` is not set to `OrganizerOnlyUserOverride`.
|
||||||
|
|
||||||
# Retrieve the Teams meeting policy for presenters
|
# Retrieve the Teams meeting policy for presenters
|
||||||
|
# $CsTeamsMeetingPolicyPresenters Mock Object
|
||||||
|
<#
|
||||||
|
$CsTeamsMeetingPolicyPresenters = [PSCustomObject]@{
|
||||||
|
DesignatedPresenterRoleMode = "Enabled"
|
||||||
|
}
|
||||||
|
#>
|
||||||
$CsTeamsMeetingPolicyPresenters = Get-CISMSTeamsOutput -Rec $recnum
|
$CsTeamsMeetingPolicyPresenters = Get-CISMSTeamsOutput -Rec $recnum
|
||||||
$presenterRoleRestricted = $CsTeamsMeetingPolicyPresenters.DesignatedPresenterRoleMode -eq 'OrganizerOnlyUserOverride'
|
$presenterRoleRestricted = $CsTeamsMeetingPolicyPresenters.DesignatedPresenterRoleMode -eq 'OrganizerOnlyUserOverride'
|
||||||
|
|
||||||
# Prepare failure reasons and details based on compliance
|
# Prepare failure reasons and details based on compliance
|
||||||
$failureReasons = if (-not $presenterRoleRestricted) {
|
$failureReasons = if (-not $presenterRoleRestricted) {
|
||||||
"Others besides organizers and co-organizers can present"
|
"Others besides organizers and co-organizers can present. Use the following command to remediate:`nSet-CsTeamsMeetingPolicy -Identity Global -DesignatedPresenterRoleMode `"OrganizerOnlyUserOverride`""
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
"N/A"
|
"N/A"
|
||||||
}
|
}
|
||||||
|
|
||||||
$details = if ($presenterRoleRestricted) {
|
$details = if ($presenterRoleRestricted) {
|
||||||
"Only organizers and co-organizers can present."
|
"Only organizers and co-organizers can present."
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
"DesignatedPresenterRoleMode is set to $($CsTeamsMeetingPolicyPresenters.DesignatedPresenterRoleMode)"
|
"DesignatedPresenterRoleMode is set to $($CsTeamsMeetingPolicyPresenters.DesignatedPresenterRoleMode)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create and populate the CISAuditResult object
|
# Create and populate the CISAuditResult object
|
||||||
$params = @{
|
$params = @{
|
||||||
Rec = $recnum
|
Rec = $recnum
|
||||||
@@ -65,7 +65,6 @@ function Test-OrganizersPresent {
|
|||||||
$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