Script to mail the password expiry report of all users in active directory.
Please modify the variables as per your concern
sendmail=1 ## [1 sends mail or 0 does not send mail] if sendmail=1 then user have to set the required information to send out a email from the code.
Please find the attachment for thePassword expiry report of all the Active directory Users report in Text file format.
emailto=['firstname.lastname@example.org'] # Provide an email where want to send report file.
email@example.com' # Provide a valid from email.
password='******' # Provide the correct password for your from mail.
smtpserver='smtp.gmail.com' #Provide the correct smpt server
port=587 #Provide the correct port number
Run the script as system user.