搜索事件查看器服务器 03 和 08 r2
有没有办法使用 powershell 或其他 cmd 或程序在 Windows Server 2003 和 Windows Server 2008 r2 中的事件查看器中搜索特定打印机名称?
有时我必须搜索事件查看器以查看谁打印了特定的打印作业,并且我们通常知道他们打印到哪台打印机,但手动搜索非常繁琐。
如果有人能够给出答案,您将需要提供整个代码,因为我是编写代码的新手。抱歉,但感谢您的帮助。
编辑: 我知道您可以导出列表,但我正在寻找的是一种解析事件描述的方法。
完成此操作的程序安装将安装在单独的计算机上,因为我们尽力保持服务器尽可能干净。除非它是一个可以在运行后立即删除的独立文件,否则所有代码都将从远程计算机运行。
我了解 Log Parser,但不确定如何使其在另一台计算机上运行,我确信我正在寻找如何做到这一点。
我将在 Win 7 Pro 64 位电脑上运行所有程序。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Get-EventLog cmdlet 获取事件日志条目。在此示例中,我连接到运行 Server 2003 的名为 STUDIO 的远程计算机,并搜索由 STUDIO\Administrator 启动的打印事件。
打印机名称包含在消息属性中,因此您可以进行正则表达式匹配。
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.
The printer name is contained in the message property so you can do a regular expression match.