![]() When installing the platform SDK, you can deselect all options except for “Developer Tools -> Windows Development Tools -> Win32 Development Tools” if you want to conserve space. The message file compiler is essential, as without it there will be no event message file unfortunately. The reason you need the platform SDK, is because Visual Studio Express does not ship with the Message Compiler, mc.exe, for some reason. To create an event message file, you need two applications: ![]() Once you have your very own event message file, you can utilize it from any application that logs to the event log, be it a PowerShell/perl/python/… script or a C/C++/C#/… application. And what’s even better, is that you can do so using all free tools. Yes, you can do all this, and impress your peers, by creating your own event message file. Logging to the event log has a number of benefits: It gives you a centralized record of your tasks, allows for translation, and gives you the ability to respond to errors immediately (well, I’m of course assuming you are using an event log monitoring solution such as EventSentry). Maybe you even have sysadmins in other countries and want to give them the ability to translate standard error messages. To make troubleshooting easier, you want to log any results to the event log – in a clean manner. Your tasks, binary as they are, usually do one of two things: They run successfully, or they fail. ![]() Let’s say you are running custom scripts on a regular basis in your network – maybe with Perl, Python, Ruby etc. We’ll start with creating the DLL using Visual Studio (Express) and finish up with some example scripts, including Perl of course, to utilize the DLL and log elegantly to the event log. In this blog post I’ll be showing you how to build a custom event message DLL, and we’ll go about from the beginning to the end. through Perl, Python, …), then you might have run into a similar problem that I described in an earlier post: Either the events don’t look correctly in the event log, you are restricted to a small range of event ids (as is the case with eventcreate.exe) or you cannot utilize insertion strings. If you’ve ever wrote code to log to the Windows event log before (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |