Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to write directly to the microsoft-windows-taskscheduler/operational  eventlog in Server2008

Posted on 2014-10-13
5
Medium Priority
?
726 Views
Last Modified: 2014-10-15
Can I (and if yes) how do I write to the microsoft-windows-taskscheduler/operational  log in the event viewer.  I want to write to this log to post a follow-up entry to Windows "Task Complete" entry which fires entirely too early when running the scheduled job of a big honkin' query.  Windows reports the job done when if fires the query off... not when the query has completed and the code completes and MSAccess shuts down.
0
Comment
Question by:jadedata
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 40379220
This is how to write to an event log using Visual C#...

How to write to an event log by using Visual C#


You can also use standard windows command line utilitiy "EventCreate"...
TechNet: Eventcreate

But it's only possible to write to Application and System event logs!
0
 
LVL 32

Author Comment

by:jadedata
ID: 40379754
Thanks Thommy,... any magic on who this can be done with VB, or more particularly VBA?

I have tried eventcreate but can only get entries into the the APPLICATION or SYSTEM logs using that.  I reeeeeally want to put an entry into the microsoft-windows-taskscheduler/operational  log directly
0
 
LVL 32

Author Comment

by:jadedata
ID: 40379797
I need to get an the properties of the even that these other tools aren't giving me.
0
 
LVL 19

Accepted Solution

by:
Thommy earned 2000 total points
ID: 40381854
Since yesterday I tried a lot, but could not achieve to write to any event log different from APPLICATION and SYSTEM.

I suppose, that it is only possible to write to these both event logs or create your own event log.

You can easily create your own event log in "Application & Services" using PowerShell...

Use PowerShell to Create Custom Log Events

C:\windows\system32>powershell
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. Alle Rechte vorbehalten.

PS C:\windows\system32> get-eventlog -list

  Max(K) Retain OverflowAction        Entries Log
  ------ ------ --------------        ------- ---
  20.480      0 OverwriteAsNeeded      34.248 Application
  20.480      0 OverwriteAsNeeded           0 HardwareEvents
     512      7 OverwriteOlder              0 Internet Explorer
  20.480      0 OverwriteAsNeeded           0 Key Management Service
   8.192      0 OverwriteAsNeeded           0 Media Center
     128      0 OverwriteAsNeeded       2.073 OAlerts
  20.480      0 OverwriteAsNeeded      34.349 Security
  20.480      0 OverwriteAsNeeded      52.770 System
     512      7 OverwriteOlder              0 Toad
  15.360      0 OverwriteAsNeeded          64 Windows PowerShell


PS C:\windows\system32> new-eventlog -logname mylog -so mylog
PS C:\windows\system32> get-eventlog -list

  Max(K) Retain OverflowAction        Entries Log
  ------ ------ --------------        ------- ---
  20.480      0 OverwriteAsNeeded      34.248 Application
  20.480      0 OverwriteAsNeeded           0 HardwareEvents
     512      7 OverwriteOlder              0 Internet Explorer
  20.480      0 OverwriteAsNeeded           0 Key Management Service
   8.192      0 OverwriteAsNeeded           0 Media Center
     512      7 OverwriteOlder              0 mylog
     128      0 OverwriteAsNeeded       2.073 OAlerts
  20.480      0 OverwriteAsNeeded      34.349 Security
  20.480      0 OverwriteAsNeeded      52.770 System
     512      7 OverwriteOlder              0 Toad
  15.360      0 OverwriteAsNeeded          64 Windows PowerShell


PS C:\windows\system32> Write-EventLog -LogName mylog -Source mylog -EntryType Error -EventID 11111 
-Message "First entry in mylog"
PS C:\windows\system32> remove-eventlog -logname mylog
PS C:\windows\system32>

Open in new window

0
 
LVL 32

Author Closing Comment

by:jadedata
ID: 40382061
I woulda give a B+... but all systems have limitations that should work in favor of the benefactor.  Thanks!  I will check this out
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question