包含EventLog名词(EventLogcmdlet)的 cmdlet 仅适用于经典事件日志。 若要从 Windows Vista 和更高版本的 Windows作系统中使用 Windows 事件日志技术的日志获取事件,请使用Get-WinEventcmdlet。 示例 示例1:将事件写入应用程序事件日志 PowerShell PS C:\>Write-EventLog-Log
Write-EventLog [-LogName] <string> [-Source] <string> [-EventID] <int> [-Message] <string> [[-EntryType] {<Error> | <Warning> | <Information> | <SuccessAudit> | <FailureAudit>}] [-Category <Int16>] [-ComputerName <string>] [-RawData <Byte[]>] [<CommonParameters>] Descript...
Source的EventLog属性尚未设置。 -或 - 该方法尝试注册新的事件源,但MachineName中的计算机名称无效。 -或 - 已为其他事件日志注册了该源。 -或 - instance.InstanceId小于零或大于UInt16.MaxValue。 -或 - values超过了 256 个元素。 -或 - values元素中有一个超过了 32766 个字节。
Write-Eventlog –LogName Application –Source 'My-App' –EntryType Error –EventID 10999 -Message 'This is test error. Please Ignore'Write-Eventlog : The source name "My-App" does not exist on computer "localhost".At line:1 char:1+ Write-Eventlog –LogName Application –So...
Event Log Search for Time / Source from Event Viewer Event Procedures for Right-Click popup menu Event-Handling on Powershell-GUI (System.Windows.Forms) Example of a function that will remove everything from my string, after first "space" character and takes whats left ? Excel & Powershell:...
Source Provides access to the Source parameter. SupportsCustomRemoting Declares whether this command supports its own custom remoting. Commands that support their own custom remoting should return TRUE from this property, and use the PSComputerName parameter as required when the 'PSRemotingBehavior' ...
问从System.Diagnostics.EventLogInternal.InternalWriteEvent写入记录器时出错EN版权声明:本文内容由互联网...
将事件写入事件日志。 语法 Write-EventLog [-LogName] <string> [-Source] <string> [-EventID] <int> [-Message] <string> [[-EntryType] {<Error> | <Warning> | <Information> | <SuccessAudit> | <FailureAudit>}] [-Category <Int16>] [-ComputerName <string>] [-RawData <Byte[]>] [...
public static void WriteEvent (string source, System.Diagnostics.EventInstance instance, params object[] values); 参数 source String 在指定的计算机上为应用程序注册的事件源的名称。 instance EventInstance 表示本地化事件日志项的 EventInstance 实例。 values Object[] 要合并到事件日志项的消息文本中的...
public static void WriteEvent (string source, System.Diagnostics.EventInstance instance, params object[] values); 参数 source String 在指定的计算机上为应用程序注册的事件源的名称。 instance EventInstance 表示本地化事件日志项的 EventInstance 实例。 values Object[] 要合并到事件日志项的消息文本中的...