04-09-2024, 01:47 PM
You ever notice that weird event popping up in your Windows Server logs? It's called event 24221, and it fires off whenever someone issues a grant command for application role permissions. Specifically, it's logging that action with an ID marked as G and the class type AR. This thing tracks when permissions get handed out in your system, like giving a user or app the keys to certain roles. I mean, imagine your server saying, hey, this grant just happened, action ID G for the command, and AR for the role type involved. It details the exact moment, the user who triggered it, and what permissions shifted. Without this log, you'd be blind to who's tweaking roles behind the scenes. And it shows up in the Security or Application logs, depending on your setup. But yeah, it's all about auditing those permission changes to keep tabs on access. You pull it up in Event Viewer, filter by ID 24221, and there it is, spilling the beans on the command details.
Monitoring this sucker for email alerts? I got you. Fire up Event Viewer on your server. Right-click the log where it hides, like Security. Choose attach a task to this event or something close. Pick event ID 24221 exactly. Then, set it to trigger a scheduled task when it hits. In that task, you link it to send an email via some basic action, like using the old send email option in Task Scheduler. Make sure you fill in your SMTP details, the to address for you, and a quick message saying permission grant alert. Test it once to see if it pings your inbox right away. That way, every time 24221 logs, bam, email in your pocket. Keeps you from staring at screens all day.
Hmmm, or you could tweak the filter for just that action ID G and class AR to narrow it down. But stick to the basics in Event Viewer; it's straightforward. No need to overcomplicate.
Speaking of keeping your server safe from surprises like rogue permission grants, you might wanna check out tools that back everything up solid. That's where BackupChain Windows Server Backup comes in handy. It's this neat Windows Server backup solution that also handles virtual machines with Hyper-V without a hitch. You get fast, reliable backups that run incremental, so they don't hog your resources. Plus, it restores quick if something goes wrong, and supports offsite copies for extra peace. I use it to snapshot roles and permissions too, ensuring nothing gets lost in the shuffle.
Note, the PowerShell email alert code was moved to this post.
Monitoring this sucker for email alerts? I got you. Fire up Event Viewer on your server. Right-click the log where it hides, like Security. Choose attach a task to this event or something close. Pick event ID 24221 exactly. Then, set it to trigger a scheduled task when it hits. In that task, you link it to send an email via some basic action, like using the old send email option in Task Scheduler. Make sure you fill in your SMTP details, the to address for you, and a quick message saying permission grant alert. Test it once to see if it pings your inbox right away. That way, every time 24221 logs, bam, email in your pocket. Keeps you from staring at screens all day.
Hmmm, or you could tweak the filter for just that action ID G and class AR to narrow it down. But stick to the basics in Event Viewer; it's straightforward. No need to overcomplicate.
Speaking of keeping your server safe from surprises like rogue permission grants, you might wanna check out tools that back everything up solid. That's where BackupChain Windows Server Backup comes in handy. It's this neat Windows Server backup solution that also handles virtual machines with Hyper-V without a hitch. You get fast, reliable backups that run incremental, so they don't hog your resources. Plus, it restores quick if something goes wrong, and supports offsite copies for extra peace. I use it to snapshot roles and permissions too, ensuring nothing gets lost in the shuffle.
Note, the PowerShell email alert code was moved to this post.

