2017-06-29 106 views

回答

0

你的意思是事件源? PowerShell的将是 则New-EventLog命令发现这里提供的更详细的编辑后

MSDM New-eventLog

你想要什么的基本原理是查询日志文件并将找到的行写入事件日志。这就好比做如下:

#Get the content of the error log, gets the top 10 lines ONLY!! 
$GetLog = Get-Content -Path D:\Errorlog.txt -totalcount 10 

#Now take the data found and write it to the event log under the source and log below 
Write-EventLog -LogName "Application" -Source "My Application" -Eventid 1001 
-EntryType Error -Message "$Getlog" -Category 1 
+0

我需要显示在事件日志窗口中的应用 myapplication.log --->应用程序事件日志窗口 –

+0

,我收到你现在的日志。我认为这是可能的....承担我 –

+0

谢谢理查德,但我怎么能够实时做到这一点 –