You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$messageDetail="Included in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."
444
+
$messageDetail2="Excluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."
424
445
if ($ShowDetailedExplanation) {
425
-
Write-Host"`t`tPolicy match found: `"$($rule.Name)`""
426
-
Write-Host ("`t`tIncluded in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."-f$emailInRule,$groupInRule,$domainInRule)
427
-
Write-Host ("`t`tExcluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."-f$emailExceptionInRule,$groupExceptionInRule,$domainExceptionInRule)
Write-Verbose"Policy match found: `"$($rule.Name)`""
430
-
Write-Verbose ("Included in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."-f$emailInRule,$groupInRule,$domainInRule)
431
-
Write-Verbose ("Excluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."-f$emailExceptionInRule,$groupExceptionInRule,$domainExceptionInRule)
$message="The rule/policy does not explicitly include the recipient because not all User, Group, and Domain properties which have values include the recipient. `n`t`tDue to the AND operator between the User, Group, and Domain inclusion properties, if any of those properties have non-null values (they are not empty), the recipient must be included in that property."
457
+
$messageDetail="Included in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."
458
+
$messageDetail2="Excluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."
435
459
if ($ShowDetailedExplanation) {
436
-
Write-Host"`t`tThe rule/policy does not explicitly include the recipient because not all User, Group, and Domain properties which have values include the recipient. Due to the AND operator between the User, Group, and Domain inclusion properties, if any of those properties have non-null values (they are not empty), the recipient must be included in that property."
437
-
Write-Host ("`t`tIncluded in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."-f$emailInRule,$groupInRule,$domainInRule)
438
-
Write-Host ("`t`tExcluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."-f$emailExceptionInRule,$groupExceptionInRule,$domainExceptionInRule)
Write-Verbose"The rule/policy does not explicitly include the recipient because not all User, Group, and Domain properties which have values include the recipient. Due to the AND operator between the User, Group, and Domain inclusion properties, if any of those properties have non-null values (they are not empty), the recipient must be included in that property."
441
-
Write-Verbose ("Included in rule as User: {0}. Included in rule by Group membership: {1}. Included in rule by Domain: {2}."-f$emailInRule,$groupInRule,$domainInRule)
442
-
Write-Verbose ("Excluded from rule as User: {0}. Excluded from rule by group membership: {1}. Excluded from rule by domain: {2}."-f$emailExceptionInRule,$groupExceptionInRule,$domainExceptionInRule)
# Check for implicit inclusion (no mailboxes included at all), which is possible for Presets and SA/SL. They are included if not explicitly excluded. Only inbound
$message="The recipient is IMPLICITLY included. There are no recipients explicitly included in the policy, and the user is not explicitly excluded either in the User, Group, or Domain exclusion properties. `n`t`tImplicit inclusion is possible for Preset policies and Safe Attachments and Safe Links in which no explicit inclusions have been made."
475
+
$messageDetail="Rule of matching policy: `"$($rule.Name)`""
450
476
if ($ShowDetailedExplanation) {
451
-
Write-Host"`t`tThe recipient is IMPLICITLY included. There are no recipients explicitly included in the policy, and the user is not explicitly excluded either in the User, Group, or Domain exclusion properties. Implicit inclusion is possible for Preset policies and Safe Attachments and Safe Links in which no explicit inclusions have been made."
452
-
Write-Host"`t`tRule of matching policy: `"$($rule.Name)`""
477
+
Write-Host"`t`t$message"
478
+
Write-Host"`t`t$messageDetail"
453
479
} else {
454
-
Write-Verbose"The recipient is IMPLICITLY included. There are no recipients explicitly included in the policy, and the user is not explicitly excluded either in the User, Group, or Domain exclusion properties. Implicit inclusion is possible for Preset policies and Safe Attachments and Safe Links in which no explicit inclusions have been made."
455
-
Write-Verbose"Rule of matching policy: `"$($rule.Name)`""
480
+
Write-Verbose$message
481
+
Write-Verbose$messageDetail
456
482
}
457
483
return$rule
458
484
}
@@ -785,7 +811,7 @@ process {
785
811
$stEmailAddress=$email.ToString()
786
812
# Initialize a variable to capture all policy details
787
813
$allPolicyDetails=""
788
-
Write-Host"`n`nPolicies applied to $stEmailAddress..."
814
+
Write-Host"`n`nPolicies applied to $stEmailAddress..."-ForegroundColor Yellow
789
815
790
816
if ( -not$OnlyMDOPolicies) {
791
817
# Check the Strict EOP rules first as they have higher precedence
0 commit comments