Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sorting in Excel with Group Headers if the Exist 2 82
word0 challenge 4 64
C# DataGridView_RowsAdded event not firing 1 63
egit plugin on eclipse 8 27
This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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…

947 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now