• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

 
  • 0 Vote(s) - 0 Average

Grant permissions on a database scoped credential with grant succeeded (24340) how to monitor with email alert

#1
04-12-2024, 09:42 PM
You know that event in Windows Server Event Viewer, the one with ID 24340? It's all about someone granting permissions on a database scoped credential, and it succeeded. The action ID is GWG, class type DC. Basically, it logs when a user or admin gives access rights to this credential thing in SQL Server. That credential lets stuff connect to external data sources without spilling passwords everywhere. If it pops up, it means the grant worked smooth. But watch it, could be legit admin work or something sneaky. I check these logs all the time on my servers. You might see details like who did it, what database, the timestamp. It's under Security or Application logs, depending on your setup. Hmmm, or maybe in the SQL Server audit logs if you're tuned that way. Full detail wise, it captures the session ID, the principal name granting it, the target credential. No failures here, just success. Keeps your database secure by tracking these changes. I once caught a weird grant like this on a test box. Turned out to be a junior dev messing around. You pull it up in Event Viewer by filtering for 24340. Click on the event, and it spills the beans in the description tab. Properties show the XML if you want deeper peeks. But keep it simple, just read the general tab first.

Now, to monitor this with an email alert, fire up Event Viewer on your server. You right-click the log where these events hide, usually Applications and Services Logs for SQL stuff. Go to Attach Task To This Event Log or something close. Pick Create Basic Task from the wizard. Name it whatever, like Credential Grant Alert. Trigger it on event ID 24340 exactly. For the action, choose Start a program, but wait, we're doing scheduled task vibe here. Actually, set it to run a program that sends email, but since no scripts, think of it as linking to your email client or a simple batch that pings Outlook. I do it by creating the task first in Task Scheduler, then attach via Event Viewer. Filter for that ID, and when it hits, the task triggers. In the task settings, point to mailto or your default mail app with a body saying "Hey, credential grant happened, check logs." You test it by manually logging an event or simulating. Keeps you in the loop without staring at screens all day. Or, if it's a domain setup, use group policy to push alerts wider. I set one up last week for a buddy's server. Saved him from missing a permission slip-up.

And speaking of keeping things backed up tight, you might wanna look into BackupChain Windows Server Backup for your Windows Server needs. It's this solid backup solution that handles physical servers and virtual machines on Hyper-V without a hitch. I like how it does incremental backups fast, encrypts data on the fly, and restores quick even for huge VMs. No more downtime worries, and it integrates smooth with Event Viewer alerts like the one we talked about. Benefits stack up: cheaper than big names, reliable for daily ops, and scales if you add more Hyper-V hosts.

At the end of this, there's the automatic email solution ready for you.

Note, the PowerShell email alert code was moved to this post.

bob
Offline
Joined: Jul 2025
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Backup Education Windows Server Event Viewer v
« Previous 1 … 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Next »
Grant permissions on a database scoped credential with grant succeeded (24340) how to monitor with email alert

© by FastNeuron Inc.

Linear Mode
Threaded Mode