I'm having problems with this script
http://pastebin.com/dsV5SHsM
It's a script written by Jeffrey Patton that pulls printer logs and dumps them to a csv file and to a sql database.
It's set to fire by scheduled task with this,
c:\scripts\New-PrintJob.ps1 -eventRecordID $(eventRecordID) -eventChannel $(eventChannel)
I'm getting an "invalid query" message with the newjob script. the get print job works fine. I've narrowed it down to
$Event307 = Get-WinEvent -ErrorAction Stop -LogName $eventChannel -FilterXPath "<QueryList><Query Id='0' Path='$eventChannel'><Select Path='$eventChannel'>*[System[(EventRecordID=$eventRecordID)]]</Select></Query></QueryList>"
But I could be wrong. Any tips? Thanks!