应用对象
Windows 10, version 1903, all editions Windows 10, version 1809, all editions Windows Server 2019, all editions Windows 10, version 1803, all editions Windows 10, version 1709, all editions Windows 10, version 1703, all editions Windows 10, version 1607, all editions Windows Server 2016, all editions Windows 10 Windows 8.1 Windows Server 2012 R2 Windows Server 2012 Windows 7 Service Pack 1 Windows Server 2008 R2 Service Pack 1 Windows Server 2008 Service Pack 2

摘要

尝试在事件查看器中扩展、查看或创建“自定义视图”时,你可能会收到错误,即“MMC 在管理单元中检测到错误并将卸载它。”而应用程序可能会停止响应或关闭。 将“操作”菜单中的“筛选当前日志”与内置视图或日志结合使用时,也可能会收到相同的错误。 事件查看器的内置视图和其他功能应按预期工作。

Event Viewer Error

Event Viewer Error

 

解决方法

若要解决此问题,请将以下函数复制并粘贴到 PowerShell 窗口中,然后运行它。 现在可以在 PowerShell 提示符中使用 get-EventViewer 命令以查看“自定义视图”。每次打开新的 PowerShell 窗口时,需要重新输入该函数。注意:get-EventViewer 函数将仅允许你查看先前定义的“自定义视图”。 若要创建新的“自定义视图”,请参阅 使用 FilterHashtable 创建 Get-WinEvent 查询

function get-EventViewer {
                Write-Output "List of custom views on the machine"
                Write-Output ""
                Get-ChildItem "C:\ProgramData\Microsoft\Event Viewer\Views" -Filter *.xml | % { select-xml -Path $_.FullName -xpath "//Name" } | Select-Object -ExpandProperty Node | Select-Object -ExpandProperty InnerXml
 
                Write-Output ""
                $view_name = Read-Host "Enter the name of custom view to execute"
 
 
                # Get the file name of the view
                $ViewFile = Get-ChildItem "C:\ProgramData\Microsoft\Event Viewer\Views" -Filter *.xml | where-object { (Select-Xml -Path $_.FullName -xpath "//Name").Node.InnerXml -eq $view_name }
 
                Get-WinEvent -FilterXml ([xml]((Select-Xml -Path $ViewFile.FullName -XPath "//QueryList").node.OuterXml))
}

 

后续步骤

所有平台的此问题现已在以下更新中解决:

  • 适用于 Windows 10 版本 1903 的 KB4501375 的 LCU。

  • 适用于 Windows 10 版本 1809 和 Windows Server 2019 的 KB4501371 的 LCU。

  • 适用于 Windows 10 版本 1803 的 KB4503288 的 LCU。

  • 适用于 Windows 10 版本 1709 的 KB4503281 的 LCU。

  • 适用于 Windows 10 版本 1703 的 KB4503289 的 LCU。

  • 适用于 Windows 10 版本 1607 和 Windows Server 2016 的 KB4503294 的 LCU。

  • 适用于 Windows 10 版本 1507 的 KB4507458 的 LCU。

  • 适用于 Windows 8.1 和 Windows Server 2012 R2 的 KB4503283 的月度汇总预览(针对使用仅安全更新的客户)。

  • Windows 8.1 和 Windows Server 2012 R2 的更新 KB4508773

  • 适用于 Windows Server 2012 和 Windows Embedded 8 Standard 的 KB4503295 的月度汇总预览。

  • Windows Server 2012 和 Windows Embedded 8 Standard 的更新 KB4508776(针对使用仅安全更新的客户)。

  • 适用于 Windows 7 SP1 和 Windows Server 2008 R2 SP1 的 KB4503277 的月度汇总预览。

  • Windows 7 SP1 和 Windows Server 2008 R2 SP1 的更新 KB4508772(针对使用仅安全更新的客户)。

  • 适用于 Windows Server 2008 SP2 的 KB4503271 的月度汇总预览。

  • Windows Server 2008 SP2 的更新 KB4508774(针对使用仅安全更新的客户)。

受影响的更新

针对受影响平台 2019 年 6 月 11 日发布的以下最新累积更新 (LCU)、月度汇总和仅安全更新可能会遇到以下问题:

  • 适用于 Windows 10 版本 1903 的 KB4503293 的 LCU。

  • 适用于 Windows 10 版本 1809 和 Windows Server 2019 的 KB4503327 的 LCU。

  • 适用于 Windows 10 版本 1803 的 KB4503286 的 LCU。

  • 适用于 Windows 10 版本 1709 的 KB4503284 的 LCU。

  • 适用于 Windows 10 版本 1703 的 KB4503279 的 LCU。

  • 适用于 Windows 10 版本 1607 和 Windows Server 2016 的 KB4503267 的 LCU。

  • 适用于 Windows 10 版本 1507 的 KB4503291 的 LCU。

  • 适用于 Windows 8.1 和 Windows Server 2012 R2 的 KB4503276 的月度汇总。

  • Windows 8.1 和 Windows Server 2012 R2 的仅安全更新 KB4503290

  • 适用于 Windows Server 2012 和 Windows Embedded 8 Standard 的 KB4503285 的月度汇总

  • Windows Server 2012 和 Windows Embedded 8 Standard 的仅安全更新 KB4503263

  • 适用于 Windows 7 SP1 和 Windows Server 2008 R2 SP1 的 KB4503292 的月度汇总

  • Windows 7 SP1 和 Windows Server 2008 R2 SP1 的仅安全更新 KB4503269

  • 适用于 Windows Server 2008 SP2 的 KB4503273 的月度汇总

  • Windows Server 2008 SP2 的仅安全更新 KB4503287

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。