Solved

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

Posted on 2014-10-13
5
528 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 64
How to split this in C++ 4 75
countPairs challenge 7 57
SUM 2 INTEGER ARRAYS INTO 1 10 53
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

728 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

15 Experts available now in Live!

Get 1:1 Help Now