Merge pull request #146 from CriticalSolutionsNetwork/Fix-pw-notification-test

Fix pw notification test
This commit is contained in:
Doug Rios
2024-07-23 08:17:32 -05:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -4,6 +4,12 @@ The format is based on and uses the types of changes according to [Keep a Change
## [Unreleased]
### Fixed
- Fixed test 1.3.1 as notification window for password expiration is no longer required.
## [0.1.24] - 2024-07-07
### Added
- New private function `Get-AuditMailboxDetail` for 6.1.2 and 6.1.3 tests to get the action details for the test.

View File

@@ -45,13 +45,12 @@ function Test-PasswordNeverExpirePolicy {
$isDefault = $domain.IsDefault
# Step (Condition C): Determine if the notification window is set to 30 days
$notificationWindow = $domain.PasswordNotificationWindowInDays
$notificationPolIsCompliant = $notificationWindow -eq 30
$notificationPolIsCompliant = $true # No longer a requirement
# Step (Condition A): Retrieve password expiration policy
$passwordPolicy = $domain.PasswordValidityPeriodInDays
$pwPolIsCompliant = $passwordPolicy -eq 2147483647
# Step (Condition A & B): Determine if the policy is compliant
$overallResult = $overallResult -and $notificationPolIsCompliant -and $pwPolIsCompliant
# Step (Condition A & B): Prepare failure reasons and details based on compliance
$failureReasons = if ($notificationPolIsCompliant -and $pwPolIsCompliant) {
"N/A"
@@ -59,18 +58,14 @@ function Test-PasswordNeverExpirePolicy {
else {
"Password expiration is not set to never expire or notification window is not set to 30 days for domain $domainName. Run the following command to remediate: `nUpdate-MgDomain -DomainId $domainName -PasswordValidityPeriodInDays 2147483647 -PasswordNotificationWindowInDays 30`n"
}
$details = "$domainName|$passwordPolicy days|$notificationWindow days|$isDefault"
# Add details and failure reasons to the lists
$detailsList += $details
$failureReasonsList += $failureReasons
}
# Prepare the final failure reason and details
$finalFailureReason = $failureReasonsList -join "`n"
$finalDetails = $detailsList -join "`n"
# Step: Create and populate the CISAuditResult object
$params = @{
Rec = $recnum
@@ -86,7 +81,6 @@ function Test-PasswordNeverExpirePolicy {
$auditResult = Get-TestError -LastError $LastError -recnum $recnum
}
}
end {
# Return the audit result
return $auditResult