Solved

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

Posted on 2014-10-13
5
573 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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

776 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