Page 1 of 1

emails not being sent from AD notifier

Posted: Tue Feb 27, 2024 10:56 pm
by eDot
We have had this working for years but recently it started not sending emails out.

I can confirm:

- the smtp settings in automate control center test successfully.
- the configuration for the client is set to a domain controller with PS ver > 3
- It is able to query the domain controller no problem and list the users who the emails should be going to
- not seeing any errors on the script log for the DC it runs against
- emails do not send either automatically or if I right click a user and hit "send email to xyz"
- no failed emails listed in the automate control center relating to this.
- we are getting other emails from automate

I'm not sure what else to check? Help a brother out

Re: emails not being sent from AD notifier

Posted: Mon Mar 04, 2024 2:03 pm
by Cubert
Sorry for the delay, Sometimes I miss some of the lower forums when posts are presented.


The password Expired emails are sent using a LTscript. This script checks for and loops through all the emails from client data and sends a email using the scripted email command in LT scripts.


Screenshot 2024-03-04 085813.png
Screenshot 2024-03-04 085813.png (37.69 KiB) Viewed 1858 times


This script typically runs on the DC for that client or location. Check the script logs from the DC agent to see if during the 12 Am or 1 pm hour Expiry script runs on DC and spits out log.

Keep in mind Expiry sends 1 email only. It does not repeated flood users with emails. It may end up in users spam.

Each email sent will have a corresponding email log entry as seen in script.

Re: emails not being sent from AD notifier

Posted: Mon Mar 04, 2024 2:06 pm
by Cubert
Just FYI, I referenced above a Habitat version of the script, They are the same script as Expiry just a different database table to store and retrieve data. The coding remains the same.

Check the DC logs over this period and see if it shows any emails going out on the pre-day number set by plugin.

So if user is set to notify 5 days before expired then look at logs on the fourth, fifth and sixth days before expire date to see if logs are present on any of those days.

Post back your findings.

Re: emails not being sent from AD notifier

Posted: Tue Mar 05, 2024 2:23 pm
by eDot
Unless there is a separate place, the script log when it runs just shows "success" from this AM.

pmg ss.png
pmg ss.png (84.59 KiB) Viewed 1836 times

Re: emails not being sent from AD notifier

Posted: Wed Mar 06, 2024 6:06 pm
by Cubert
Ok so you are using Habitats AD notifier and not the standalone version... Just so I know where to go look for issues.


Success is given on line 13 after the main read and save of data. next we execute a Powershell script to see if we are between time frame 8am and 3 pm, if so script echos "sendmail" to which we drop into loop to send any email needed.

It looks like your script is not running at 1pm as it should, which would put it between 8am and 3pm which would past test.

Code: Select all

$min = Get-Date '8:00'
$max = Get-Date '16:00'
$now = Get-Date

if ($min.TimeOfDay -le $now.TimeOfDay -and $max.TimeOfDay -ge $now.TimeOfDay) {
  # send mail
   write-output "sendmail"
}
Script should run twice a day, 12 am ish, and 1pm ish. The test prevents 2 emails from being sent in same day forcing it to skip the first run of script and only send email on second run of script.

What time did script run?

Re: emails not being sent from AD notifier

Posted: Wed Mar 06, 2024 6:11 pm
by Cubert
You can disable script functions for line 15, 16 , and 17 (right click each line to disable lines in script).

Once these 3 lines are disabled then every time script runs it will test for emails and send 2 emails when a user comes up for notifications instead of one.

At least it should now send a email at 12 am and 1 pm on the day of notice count set in plugin.

Re: emails not being sent from AD notifier

Posted: Thu Mar 07, 2024 3:26 pm
by eDot
The script only seems to be running around 5 am. I'll try editing those script lines out.
pmgss2.png
pmgss2.png (57.3 KiB) Viewed 1786 times

Re: emails not being sent from AD notifier

Posted: Thu Mar 07, 2024 7:56 pm
by Cubert
That is odd... should be on ISync timing in Automate which is 12 am and 1PM (twice a day).

I'll go look and see if I may have adjusted something to cause it to change.

Otherwise the edits will fix you up.

Re: emails not being sent from AD notifier

Posted: Thu Mar 07, 2024 11:08 pm
by eDot
Update. The script just ran on the client except this time. I see all the script log entries for who it sent out which I confirmed shows up in the clients email logs.

So seems like something is throwing off the script timing by 5 hours?
pmgss3.png
pmgss3.png (81.75 KiB) Viewed 1769 times