如何使用 Get-EventLog 在 PowerShell 中获得与 Get-WinEvent 相同的结果?

gjjhhh_

我正在 Windows Server 2003 上工作,我需要使用此命令获得如下内容 Get-WinEvent -ListLog Application, Security, System

LogMode   MaximumSizeInBytes RecordCount LogName
-------   ------------------ ----------- -------
Circular            33554432       15188 Application
Circular           201326592      298459 Security
Circular            33554432       10074 System

我需要属性的结果,MaximumSizeInBytesGet-WinEvent在 Server 2003 上不受支持

我看到Get-EventLog有一个属性被调用,MaximumKilobytes但我得到的结果是不同的

我想知道是否有一个命令可以在本地运行以获得相同的结果

gjjhhh_

由于没有人提供令人满意的答案,我将在这里发布我在网上找到的答案以下命令救了我的命:

Get-WmiObject -Class Win32_NTEventLogFile | Select-Object -Property MaxFileSize, LogfileName, Name, NumberOfRecords

我不会选择我自己的答案作为最终答案,所以如果您能想到更好的解决方案,请随时添加它:)

感谢您查看我的帖子并尝试提供帮助

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用 consul http api 获得与 consul kv get -recurse 相同的结果?

Powershell - Get-WinEvent 替换文本

无法在Powershell Get-Eventlog中获取ComputerName

使用 PowerShell Get-WinEvent 或 Get-WMIObject 查询 Windows 更新错误

Get-WinEvent脚本

Powershell Get-EventLog 如何将来电者计算机名称剥离到变量中

Powershell过滤来自Get-WinEvent的输出数据

如何使用curl来获得与使用Chrome完全相同的GET请求?

如何使用Get-WinEvent cmdlet获取最新日志?

Powershell:无法使用 Get-EventLog 获取特定事件 IDS 的输出

如何为“ get-eventlog”注册事件?

Powershell Get-EventLog 在其消息中查找具有匹配字符串的事件

Powershell Get-Eventlog对象输出问题

Get-WinEvent 与匹配 TimeCreated

使用Get-WinEvent检索用户名

使用GroupBy()时如何从select中获得与foreach相同的结果

如何在 Python 中获得与在 Excel 中使用 SLOPE 相同的结果?

每次运行get-eventlog返回不同的结果

如何使用fetch()获得与fetchAll()相同的结果?

从 Powershell Get-WinEvent 分组和选择前 1 个事件

PowerShell,Get-WinEvent -FilterHashTable ID和数组的怪异行为

PowerShell Get-Winevent按关键字和提供程序名称的问题

PowerShell Get-WinEvent仅显示Message属性的第一行吗?

Powershell - Get-WinEvent - 发送带有来自事件的消息的电子邮件

如何获得与node.js中的Java .readUTF()相同的结果?

如何在 OpenCV 中获得与 ImageMagick 的“convert -fft”完全相同的结果?

捕获Get-EventLog错误

Get-EventLog - 缺少 DLL

如何使用dplyr获得相同的分组结果以获得与sqldf结果一致的结果?