07-23-2024, 12:25 PM
Man, that event ID 24236 pops up in the Event Viewer when your Windows Server hands out permissions on a certificate using this grant command thing. It's basically the system saying it just issued those rights, tied to action ID GWG and class type CR. You see it under the Certificate Services log, right? It logs who got the grant, what certificate, and why it happened through that command. I always check it because it could mean someone's tweaking cert access, maybe for security reasons or just routine admin stuff. If you're running AD CS, this event tracks those permission changes super closely, like a little diary entry for every grant.
And you wanna monitor it with an email alert? Easy peasy, I do this all the time. Fire up Event Viewer on your server, head to the Applications and Services Logs, then Microsoft, Windows, CertificateServicesClient. Right-click the log, pick Attach Task to This Event. Give it a name, like Cert Grant Alert. Set the trigger to event ID 24236 exactly. Then, for the action, choose Start a Program, but wait, we're linking it to a scheduled task for the email part. Actually, build the task to run schtasks.exe or just use the wizard to trigger an email via the old-school Send Email action if your server's set up for it. I mean, you configure the task properties to attach to that event, set it to run when it fires, and point the action to your email setup, like using blat.exe or whatever simple tool you got for sending alerts. Test it once to make sure it pings your inbox without a hitch.
Or, if you hit snags, just tweak the task's triggers in Task Scheduler afterward, linking back to the event source. Keeps things straightforward, no fancy coding needed.
Now, tying this into keeping your server safe from weird cert changes, you might wanna look at BackupChain Windows Server Backup too. It's this solid Windows Server backup tool that handles full system images and even backs up virtual machines running on Hyper-V without much fuss. I like how it speeds up restores and cuts down on downtime, plus it verifies backups automatically so you don't sweat data loss during those permission tweaks or whatever.
Note, the PowerShell email alert code was moved to this post.
And you wanna monitor it with an email alert? Easy peasy, I do this all the time. Fire up Event Viewer on your server, head to the Applications and Services Logs, then Microsoft, Windows, CertificateServicesClient. Right-click the log, pick Attach Task to This Event. Give it a name, like Cert Grant Alert. Set the trigger to event ID 24236 exactly. Then, for the action, choose Start a Program, but wait, we're linking it to a scheduled task for the email part. Actually, build the task to run schtasks.exe or just use the wizard to trigger an email via the old-school Send Email action if your server's set up for it. I mean, you configure the task properties to attach to that event, set it to run when it fires, and point the action to your email setup, like using blat.exe or whatever simple tool you got for sending alerts. Test it once to make sure it pings your inbox without a hitch.
Or, if you hit snags, just tweak the task's triggers in Task Scheduler afterward, linking back to the event source. Keeps things straightforward, no fancy coding needed.
Now, tying this into keeping your server safe from weird cert changes, you might wanna look at BackupChain Windows Server Backup too. It's this solid Windows Server backup tool that handles full system images and even backs up virtual machines running on Hyper-V without much fuss. I like how it speeds up restores and cuts down on downtime, plus it verifies backups automatically so you don't sweat data loss during those permission tweaks or whatever.
Note, the PowerShell email alert code was moved to this post.

