Skip to content

Commit

Permalink
Display some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Aug 23, 2024
1 parent 3482abd commit 2a25f35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Private/Invoke-PasswordRuleProcessing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
}
}
if ($SendToManager -and $Rule.SendToManager.Manager.IncludeGroup.Count -gt 0) {
# Rule defined that only user withi specific group has to be found
# Rule defined that only user within specific group has to be found
$FoundGroup = $false
foreach ($Group in $Rule.SendToManager.Manager.IncludeGroup) {
if ($User.MemberOf -contains $Group) {
Expand Down Expand Up @@ -415,6 +415,13 @@
Add-ManagerInformation @Splat
}
}
} else {
if ($Rule.SendToManager.Manager) {
# Manager rule is enabled but manager is not enabled or has no email
if ($Logging.NotifyOnUserMatchingRuleForManagerButNotCompliant) {
Write-Color -Text "[i]", " User (manager rule) ", $User.DisplayName, " (", $User.UserPrincipalName, ")", " days to expire: ", $User.DaysToExpire, ", manager status: ", $User.ManagerStatus, ". Reason to skip: ", "No manager or manager is not enabled or manager has no email " -Color Yellow, White, Yellow, White, Yellow, White, White, Red, White, Red, White, Red
}
}
}
}
# Lets find users that have no manager, manager is not enabled or manager has no email
Expand Down

0 comments on commit 2a25f35

Please sign in to comment.