事件日志中每个启动WMI错误:EventID 5605

我有几个服务器,我不断得到EventID错误5605

root \ cimv2 \ TerminalServices命名空间标有RequiresEncryption标志。 如果脚本或应用程序没有适当的身份validation级别,则可能会拒绝对此名称空间的访问。 将身份validation级别更改为Pkt_Privacy,然后再次运行脚本或应用程序。

问题是我不知道这个脚本是从哪里运行的,所以我不能更新脚本来解决问题,就像我在事件5605上find的每一个其他post。我检查了启动脚本的GPO,我检查了我的所有域的SYSVOL共享为VBScript或Powershell脚本。 我无法在任何地方find这个脚本。 我怎样才能跟踪这个脚本,并修复它,所以它不会抛出这个错误?

在事件查看器中使用WMI事件跟踪 ,这将允许您将WMI查询链接到特定的进程。

  1. 打开事件查看器。
  2. 在视图菜单上,单击显示分析和debugging日志。
  3. 在“应用程序和服务日志”下findWMI的跟踪通道日志 微软| Windows | WMI活动。
  4. 右键单击跟踪日志,然后select日志属性。
  5. 单击启用日志loggingcheckbox以启动WMI事件跟踪。

WMI事件显示在WMI活动的事件窗口中。

这个事件日志有时候会很痛苦,所以你可以使用这样的脚本来启动跟踪和查看事件,在WMI查询中附加进程名称:

$wmiLog = "Microsoft-Windows-WMI-Activity/Trace" echo y | Wevtutil.exe sl $wmiLog /e:true Read-Host -Prompt "Tracing WMI Started. Press [ENTER] to stop" echo y | Wevtutil.exe sl $wmiLog /e:false $events = Get-WinEvent -LogName $wmiLog -Oldest | Where-Object {$_.message.Contains("Operation = Start") -or $_.message.Contains("Operation = Provider") } if ($events -eq $null) { Write-Host "No WMI events in trace!" return } $table = New-Object System.Data.DataTable [void]$table.Columns.Add("Computer") [void]$table.Columns.Add("Namespace") [void]$table.Columns.Add("Type") [void]$table.Columns.Add("Query") [void]$table.Columns.Add("UserName") [void]$table.Columns.Add("Process") ForEach ($event in $events) { switch ($event.Properties.Count) { 6 { $typeStart = $event.Properties[1].Value.IndexOf("::")+2 $typeEnd = $event.Properties[1].Value.IndexOf(" ",$typeStart) $type = $event.Properties[1].Value.Substring($typestart,$typeEnd-$typeStart) $query = $event.Properties[1].Value.Substring($event.Properties[1].Value.IndexOf(":",$typeEnd)+2) $process = Get-Process -Id ($event.Properties[2].Value) -ErrorAction SilentlyContinue if ($process -eq $null) { $process = "($($event.Properties[2].Value))" } else { $process = "$($process.Name) ($($process.Id))" } [void]$table.Rows.Add(` $env:COMPUTERNAME,` "\\.\root\cimv2",` $type,` $query,` "N/A", $process) } 8 { $typeStart = $event.Properties[3].Value.IndexOf("::")+2 $typeEnd = $event.Properties[3].Value.IndexOf(" ",$typeStart) $type = $event.Properties[3].Value.Substring($typestart,$typeEnd-$typeStart) $query = $event.Properties[3].Value.Substring($event.Properties[3].Value.IndexOf(":",$typeEnd)+2) $process = Get-Process -Id ($event.Properties[6].Value) -ErrorAction SilentlyContinue if ($process -eq $null) { $process = "($($event.Properties[6].Value))" } else { $process = "$($process.Name) ($($process.Id))" } [void]$table.Rows.Add(` $event.Properties[4].Value,` $event.Properties[7].Value,` $type,` $query,` $event.Properties[5].Value, $process) } default { Write-Error "Unexpected number of event properties." Write-Host $event Write-Host $event.Properties } } } $table | Out-GridView 

Windows Driver Kit(WDK)中的 Tracelog.exe和tracefmt.exe也可用于WMI跟踪。

由于这是WMI,它通常反映了一个远程调用。 例如,Lansweeper扫描程序会触发此错误,但针对不同的名称空间:root \ cimv2 \ Security \ MicrosoftTPM。 您可能需要监视到达受影响的服务器的networkingstream量,以便确定WMI查询的来源(如果它不是本地的)。