Account Expiry Email Alert

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)

Account Expiry Email Alert


Recently there was a requirement to monitor service accounts expiration, as in our enviornment every service account is configured for expiry

& if it is missed than it can cause issues with Critical Applications.

This script will monitor accounts mentioned in csv file & send email alerts to corresponding email before 15 days account expiry date is reached.


extract the zip file, Change the below variables at the beginning of the script, update the csv file with the accounts that you want to monitor  and schedule the batch file thru task scheduler.

$smtpserver = “smtpserver”

$from = “”

$days = “-15”   —This is the number of days before you want the reminder email to be sent

$errormail = “” (if script resulted in some sort of error than it should be reported to some email)


download Quest Management Shell (its a free shell) –>

Note:–  Quest Management Shell is required for this script to work.

Tech Wizard

PowerShell Cheat Book

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s