Last active
August 29, 2015 14:23
-
-
Save normansolutions/7d245b25f86d6776c4f4 to your computer and use it in GitHub Desktop.
PowerShell Script To Notify When User Account Has Been Locked Out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# Please Configure the following variables - $smtpServer and $from | |
# Leave the $event and $body variables as they are | |
$smtpServer="YOUR SMTP SERVER" | |
$from = "SET FROM EMAIL ADDRESS" | |
$event = Get-EventLog -LogName Security -InstanceId 4740 -Newest 1 | |
$body = $event.Message + "`r`n`t" + $event.TimeGenerated | |
######################################################################## | |
Send-Mailmessage -smtpServer $smtpServer -from $from -to $from -subject "Account Lockout" -body $body -priority High |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment