Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
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…

856 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