So I was assigned the task to figure out a way to send an email notification when a user account has been locked out in an economical fashion (please read as free).

I thought that I could go with an Event Viewer reader and some how parse out all of the Event IDs from each domain controller and then figure out a way to send an email notification out from there. Not really feasible.

Thus I found this nifty utility: Unlock Utility

 Code:
unlock.exe . * -view


By running the command above I can get a list of domain accounts who are currently locked out.

If an account is found to be locked out it will appear as follows:
 Code:
 1: [i]username[/i]03/13/2009-15:09:38 LOCKED   VIEW_ONLY 


If not accounts are found it shows the following:
 Code:
No Objects Found 


So now I want to figure out a way to "automate" this. I know that since this is a free solution there is no way to "instantly automate" it. However, here are my thoughts:

Create the script and assign it as a schedule task to run every minute. If a locked account(s) are found have it copy that portion to the body of an email and send it using blat or some other email utility. If "No Objects Found" is returned then end the script and close it (no email sent).

I have the idea of how it would work, I am just having issues executing it. Seeing that I haven't had to touch a KiX script in over a year my skills and knowledge are seriously lacking. Thus I turn to the experts, you guys! \:\)

Any help is appreciated! Thanks a bunch!