Thanks in advance for any help. I'm trying to use PowerShell V5 to generate an event in which I can trigger an action. In the example, I'm just trying to write-output as my action. When I print, the event isn't triggered though. What am I missing?

$print = new-object system.drawing.printing.printdocument
register-objectevent -inputobject $print -eventname beginprint -sourceidentifier print.beginprint -Action { write-output "Event triggered" }

Get-job shows the job in a 'Not Started' state.

Thanks again.

1 Answer 1


I couldn't get the above to trigger a print job. Went down the path of using register-cimindication event.

To check the event log for a print, see: https://social.technet.microsoft.com/Forums/scriptcenter/en-US/4ae9aee9-44e1-445e-a3c3-77a32f6d2318/getciminstance-not-finding-all-event-logs-in-win32ntlogevent?forum=ITCG as get-ciminstance/WMI doesn't browse that Event Log until you add an entry into the registry. Thanks jrv from the link for helping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.