06-11-2024, 03:56 AM
You know that event ID 4720 in Windows Server Event Viewer? It pops up whenever someone creates a new user account on your domain. I mean, think about it, if you're running a server setup, this logs every time a fresh username gets added to the mix. The details inside it spill out who did the creating, like the account name of the creator, the new user's name, and even the time stamp down to the second. It hits the Security log mostly, under the Account Management category, and it's got levels like information to flag it's not an error but something that happened. Security folks love it because spotting unauthorized new accounts can stop sneaky stuff early, you get the SID numbers too, which are those unique identifiers for accounts. And if your server's hooked into Active Directory, this event fires right there, capturing the domain controller's take on the whole thing.
But monitoring it? You can set up alerts without getting all scripty on it. I do this by jumping into Event Viewer first, you right-click the Security log and filter for ID 4720 to see past ones. Then, to make it ping you via email, create a custom view in there for just that event, save it so it's easy to check. Now, for the alert part, you head to Task Scheduler through the Event Viewer itself, link a task to trigger on that 4720 event. I set mine to run a simple program that shoots off an email, like using the built-in mail setup or a basic tool. You pick the triggers tab, add the event ID, and boom, it watches the log live. Test it by making a dummy account, see if the task fires and your inbox lights up. Keeps you in the loop without constant babysitting.
Or, if you want it smoother, attach actions like starting a batch file that handles the email send through your SMTP server. I tweak the conditions so it only runs when you're online, avoids false alarms during maintenance. You can even throttle it if too many hit at once, but for user creation, it's usually chill.
Hmmm, speaking of keeping your server humming without surprises like rogue accounts, you might wanna think about backups too, right? That's where something like BackupChain Windows Server Backup comes in handy for me. It's this solid Windows Server backup tool that snapshots your whole setup, files and all, and it handles virtual machines backup with Hyper-V without a hitch. I like how it does incremental stuff to save space and time, plus verifies everything so you restore fast if disaster strikes, no data loss headaches.
Note, the PowerShell email alert code was moved to this post.
But monitoring it? You can set up alerts without getting all scripty on it. I do this by jumping into Event Viewer first, you right-click the Security log and filter for ID 4720 to see past ones. Then, to make it ping you via email, create a custom view in there for just that event, save it so it's easy to check. Now, for the alert part, you head to Task Scheduler through the Event Viewer itself, link a task to trigger on that 4720 event. I set mine to run a simple program that shoots off an email, like using the built-in mail setup or a basic tool. You pick the triggers tab, add the event ID, and boom, it watches the log live. Test it by making a dummy account, see if the task fires and your inbox lights up. Keeps you in the loop without constant babysitting.
Or, if you want it smoother, attach actions like starting a batch file that handles the email send through your SMTP server. I tweak the conditions so it only runs when you're online, avoids false alarms during maintenance. You can even throttle it if too many hit at once, but for user creation, it's usually chill.
Hmmm, speaking of keeping your server humming without surprises like rogue accounts, you might wanna think about backups too, right? That's where something like BackupChain Windows Server Backup comes in handy for me. It's this solid Windows Server backup tool that snapshots your whole setup, files and all, and it handles virtual machines backup with Hyper-V without a hitch. I like how it does incremental stuff to save space and time, plus verifies everything so you restore fast if disaster strikes, no data loss headaches.
Note, the PowerShell email alert code was moved to this post.

