This script will retrieve Applied Password Policy status from endpoint under Group policy as a report and sends the report to the preferred mail address.
Run this Script as " SYSTEM USER "
This script will very that the system has applied policies with following configurations. If not it will throw an alert and show actual configurations :
Give the receiver email address,sender email address and sender app password
Sender = "firstname.lastname@example.org" ## Provide the From Email address from which the mail to be send
Password = "pgihmssgyguhhhhd" ##Provide the 16 digit app password for sender email
emailto= "email@example.com" ## receiver email address
1.Run the script as Local System user
2. Enable 2 factor authentication for sender email address from that account
3. Create app password for sender email address which you have to provide in the script.