Bug with manager notification
Hello
I found few bugs, when manager receive notification of user password expiration:
- Every time logo inserted in template, even if i remove it from $FormattingParameters
- ManagerDisplayName doesnt work.
- Problem with EmailSentTo, if user has no email - in report Not available, if user have email - in report N/A Here is logs from script:
[2020-09-17 15:43:47] [i] Starting processing Users section
[2020-09-17 15:43:47] [i] User USER1 expires in 1 days (09/19/2020 01:35:46). However user has no email address and will be skipped.
[2020-09-17 15:43:47] [i] User USER2 expires in 1 days (09/19/2020 01:46:32).
[2020-09-17 15:43:47] [i] Pretending to send email to [email protected] ...Success
[2020-09-17 15:43:47] [i] Ending processing Users section
Thank you!
Please insert your configuration here.
Hello dear Przemyslaw!
I almost use config from your example.
Here is it:
RemindersSendToManager = @{
Enable = $true # doesn't processes this section at all if $false
RemindersDisplayOnly = $false # prevents sending any emails (good for testing)
SendToDefaultEmail = $true # if enabled $EmailParameters are used (good for testing)
ManagersEmailSubject = "Manager Subject"
Reports = @{
IncludePasswordNotificationsSent = @{
Enabled = $true
IncludeNames = 'DisplayName', 'DaysToExpire', 'EmailSentTo'
TextBeforeReport = '"Following users which you are listed as manager for have their passwords expiring soon:"'
}
}
# You can use limit scope
#LimitScope = @{
# Groups = 'RecursiveGoup-FGP-Check'
#}
# SendCountMaximum = 3
}
and config for users, i use Rules
[ordered] @{
Enable = $true # doesn't processes this section at all if $false
RemindersDisplayOnly = $true # prevents sending any emails (good for testing) - including managers
SendToDefaultEmail = $true # if enabled $EmailParameters are used (good for testing)
Reminders = 1, 2, 3, 4, 5 #50
#UseAdditionalField = 'extensionAttribute13'
#SendCountMaximum = 3
# this means we want to process only users that NeverExpire
#PasswordNeverExpires = $true
#PasswordNeverExpiresDays = 30
# limit group or limit OU can limit people with password never expire to certain users only
LimitGroup = @(
#'CN=GDS-PasswordExpiryNotifications,OU=Security,OU=Groups,OU=Production,DC=ad,DC=evotec,DC=xyz',
#'CN=GDS-TestGroup9,OU=Security,OU=Groups,OU=Production,DC=ad,DC=evotec,DC=xyz'
)
LimitOU = @(
'*MY_OU_HERE_1',
'*MY_OU_HERE_2'
)
}
this is my manager template:
TemplateForManagers = "
Hello <<ManagerDisplayName>>,
BLABLABLA
<<ManagerUsersTable>>
"
One quick fix: just add 'Manager' in to IncludeNames But I doesn’t want show this field. Because those manager receive report.
Reports = @{
IncludePasswordNotificationsSent = @{
Enabled = $true
IncludeNames = 'DisplayName', 'DaysToExpire', 'EmailSentTo', 'Manager'
TextBeforeReport = '"Following users which you are listed as manager for have their passwords expiring soon:"'
}
}
And I completely remove company-logo, but it still in email.
And thats why I got 'N/A' in manager report.
Users settings:
[ordered] @{
Enable = $true # doesn't processes this section at all if $false
RemindersDisplayOnly = $true # prevents sending any emails (good for testing) - including managers
SendToDefaultEmail = $false # if enabled $EmailParameters are used (good for testing)
Reminders = 1, 2, 3 #50
Managers settings:
RemindersSendToManager = @{
Enable = $true # doesn't processes this section at all if $false
RemindersDisplayOnly = $false # prevents sending any emails (good for testing)
SendToDefaultEmail = $true # if enabled $EmailParameters are used (good for testing)
if ($ConfigurationParameters.RemindersSendToManager.RemindersDisplayOnly -eq $true) {
Write-Color @WriteParameters -Text "[i] Pretending to send email to manager email ", "$($m)", " ...", "Success" -Color White, Green, White, Green
$EmailSent = @{ }
$EmailSent.Status = $false
$EmailSent.SentTo = 'N/A'
}
So it's just misconfiguration on your part, not a bug. The bug you report is basically a problem with a logo, and nothing else, right?
So it's just misconfiguration on your part, not a bug. The bug you report is basically a problem with a logo, and nothing else, right?
Hm, not exactly. I doesn’t want to send email to users. I just want to notice managers . Anyway, I got 'N/A' instead real user email. Just try disable user notification and leave only manager report.
In addition , without adding 'Manager' in to IncludeNames - manager email would be without manager name.
That's for you to configure. YOu can configure your own reports.
ReminersDisplayOnly is not for what you want. it's for testing not preventing users from receiving emails.
That's for you to configure. YOu can configure your own reports.
ReminersDisplayOnly is not for what you want. it's for testing not preventing users from receiving emails.
Okay. I doesn’t want to inform users about password expiration , but I want to inform managers about that. How can I do that?
Yeah. I can confirm: if mail was not sent - EmailSentTo = N/A
I should use different field with User Email?
UPD: just use EmailAddress instead EmailSentTo
But script still put company-logo, even if I remove it from code