Is there a way to search the event viewer in Windows Server 2003 and Windows Server 2008 r2 for a particular printer name using powershell or another cmd or program?
From time to time I have to search event viewer to see who printed a particular print job and we usually know what printer they printed to, but it is very tedious to search manually.
If anyone is able to give an answer you will need to give the whole code since I am new to writing code. Sorry, but thank you for your help.
Edit: I know you can export the list but what I am looking for is a way to parse the description of the events.
Program installs to complete this will be installed on a seperate computer as we try to keep our servers as clean as possible. Unless it is a standalone file that can be removed as soon as it is run all code will be run from a remote computer.
I kow about Log Parser but am unsure how to make it run on another computer, I'm sure I'm looking right past how to do it.
I will be running all programs from a Win 7 Pro 64 bit pc.
You can use the Get-EventLog cmdlet to obtain event log entries. In this example I connect to a remote computer named STUDIO running Server 2003 and search for Print events initiated by STUDIO\Administrator.
Get-EventLog -ComputerName studio -LogName System -Source Print -UserName "STUDIO\Administrator"
The printer name is contained in the message property so you can do a regular expression match.
Get-EventLog -ComputerName studio -LogName System -Source Print -UserName "STUDIO\Administrator" | where-object {$_.Message -match "PrinterName"}