Skip to content

Commit 98eb698

Browse files
committed
fix contact logic
1 parent bebc72e commit 98eb698

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardMailContacts.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ function Invoke-CIPPStandardMailContacts {
7474
Write-StandardsAlert -message "Marketing contact email is not set to $($Contacts.MarketingContact)" -object $Object -tenant $tenant -standardName 'MailContacts' -standardId $Settings.standardId
7575
Write-LogMessage -API 'Standards' -tenant $tenant -message "Marketing contact email is not set to $($Contacts.MarketingContact)" -sev Info
7676
}
77-
if ($CurrentInfo.securityComplianceNotificationMails -eq $Contacts.SecurityContact) {
77+
if (!$Contacts.SecurityContact -or $CurrentInfo.technicalNotificationMails -contains $Contacts.SecurityContact) {
7878
Write-LogMessage -API 'Standards' -tenant $tenant -message "Security contact email is set to $($Contacts.SecurityContact)" -sev Info
7979
} else {
80-
$Object = $CurrentInfo | Select-Object securityComplianceNotificationMails
80+
$Object = $CurrentInfo | Select-Object technicalNotificationMails
8181
Write-StandardsAlert -message "Security contact email is not set to $($Contacts.SecurityContact)" -object $Object -tenant $tenant -standardName 'MailContacts' -standardId $Settings.standardId
8282
Write-LogMessage -API 'Standards' -tenant $tenant -message "Security contact email is not set to $($Contacts.SecurityContact)" -sev Info
8383
}
84-
if ($CurrentInfo.technicalNotificationMails -eq $Contacts.TechContact) {
84+
if (!$Contacts.TechContact -or $CurrentInfo.technicalNotificationMails -contains $Contacts.TechContact) {
8585
Write-LogMessage -API 'Standards' -tenant $tenant -message "Technical contact email is set to $($Contacts.TechContact)" -sev Info
8686
} else {
8787
$Object = $CurrentInfo | Select-Object technicalNotificationMails

0 commit comments

Comments
 (0)