Login to participate
Endpoint Management & Virtualization BlogsRSS

When All Else Fails, Read the Manual... Then Again...

songs's picture

On page 187 in the DS SP2 Admin guide, it shows an example of the WLogEvent command used with the -ss switch inside double-quotes. While that syntax may work for you, it didn't for me. As expected, you need the switch (-ss) outside of the quotes, and the message you are sending (if spaces are included) to be quoted.

From the manual:

.\WLogevent.exe -c:0 -l:1 "-ss:Finished with the DIR command on %NAME%" 

What worked for me:

.\WLogevent.exe -c:0 -l:1 -ss:"Finished with the DIR command on %NAME%" 

Another curious issue is that when attempting to use WLogEvent to return various return codes from a script, I could only get the task to process the return code correctly if the level (-l switch) was a 3; level 1 and 2 were ignored regardless of the return code provided (-c switch). Perhaps the latter was by design, but not well documented...

Perhaps everyone already knew this, but thought it was worth a FYI post.

Of course, YMMV :)