报告SCEP更新和扫描

我在所pipe理的所有工作站上使用Microsoft System Center Endpoint Protection。 对于所有三个主要的平台,让它报告上次更新和上次扫描的时间是一个痛苦。 通过parsing系统日志,我可以检索Mac和Linux的date,但是Windows一直非常难以捉摸。

我可以在GUI中看到date和时间,但在几十台计算机上运行自动化报告是不切实际的。 有谁知道的方式(最好使用PowerShell,但我可以使任何工作)输出这种数据使用某种脚本?

好吧,我写了下面的PowerShell脚本来从日志中提取最近更新的date。 SCEP的日志loggingfunction中有一个错误“成功”,所以当你注意到我在下面的代码中有一个错字时,它就会匹配我正在search的日志中的错误。

$a=Select-String -Pattern "Update completed succesfully" -Path C:\Windows\Temp\MpCmdRun.log | Foreach {($_ -split ':')[2]} $lineNumber = $($a | measure -Maximum).Maximum + 1 $lastUpdate = Get-Content -Path C:\Windows\Temp\MpCmdRun.log | Select-Object -Index $lineNumber | Foreach {($_ -split ':\s')[2]} $lastUpdate = $lastUpdate.Replace("$([char]8206)","") Write-Host "scep_last_update=$lastUpdate" 

那么根据这个关于Forefront Enterprise Protection的Technet页面 (和SCEP是同一个产品,和Security Essentials等等是一样的产品),下面的产品存在日志位置,你可以用它来parsing一些PowerShell的信息你所寻求的:

  • %allusersprofile%\Microsoft\Microsoft Antimalware\Support
    • 特定于反恶意软件服务的日志文件
  • %allusersprofile%\Microsoft\Microsoft Security Client\Support
    • 日志文件特定于SCEP客户端软件
  • %windir%\WindowsUpdate.log
    • Windows更新日志文件,其中包含有关定义更新的信息
  • %windir%\CCM\Logs\EndpointProtectionagent.log
    • 显示应用的端点版本和策略
  • %windir%\temp\MpCmdRun.log
    • 执行扫描和签名更新时的活动
  • %windir%\temp\MpSigStub.log
    • 更新签名和引擎更新的进度

我也偶然发现了SCEP的本地cmdlet,您可以使用Get-Command -Module MpProvider它们,但是它们不会为我执行操作,我无法执行Update-Help或在Microsoft网站上查找有关它们的信息。所以我放弃了。 也许你会有更好的运气 – 他们似乎基本上与Windows Defender的cmdlet相同。