Sunday, June 15, 2014

Account Expiry Email Alert

Hi Readers,
Recently there was a requirement to monitor service accounts expiration, as in our environment 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.
http://gallery.technet.microsoft.com/Account-Expiry-Email-Alert-968c487e
$smtpserver = "smtpserver"
$from = "AccountExpiry@labtest.com"
$days = "-15"   ---This is the number of days before you want the reminder email to be sent
$errormail = "vikassukhija@labtest.com" (if script resulted in some sort of error than it should be reported to some email)
 Result:
download Quest Management Shell (its a free shell) --> http://www.quest.com/powershell/activeroles-server.aspx
 Note:-  Quest Management Shell is required for this script to work.
Regards
Sukhija Vikas
http://msexchange.me

No comments:

Post a Comment