小编Jef*_*ert的帖子

使用 Powershell,如果最近的事件日志事件超过一小时,则触发操作

我们有一台服务器运行我们的备份软件,该软件有自己的事件日志。我可以使用以下命令检索最新的事件日志条目:

Get-EventLog EventLogName -ComputerName server.example.com -newest 1
Run Code Online (Sandbox Code Playgroud)

这给了我这样的结果:

Index Time          EntryType   Source                InstanceID Message
----- ----          ---------   ------                ---------- -------
64292 Aug 13 15:51  Information BackupSoftware             29593 Transfer of 1096 KB...
Run Code Online (Sandbox Code Playgroud)

如果最近事件的时间戳超过一小时,我想做的是触发一个操作(例如,启动第二个脚本)。

任何帮助,将不胜感激。

windows powershell windows-event-log

4
推荐指数
1
解决办法
1280
查看次数

标签 统计

powershell ×1

windows ×1

windows-event-log ×1