You are currently viewing PowerShell New-EventLog Cmdlet

PowerShell New-EventLog Cmdlet

PowerShell New-EventLog Cmdlet

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed Get-WinEvent cmdlet in PowerShell.

https://cloudaffaire.com/powershell-get-winevent-cmdlet/

In this blog post, we will discuss New-EventLog cmdlet in PowerShell. You can use New-EventLog cmdlet to create a new Windows event log. You can also define an event source to write on your new event log or use an existing event log using New-EventLog cmdlet. In windows, event logs are stored in a file with 1st eight characters of the log name with .evt extension under $env:SystemRoot\System32\Config directory. The log file is only created once at least one log has been written. New-EventLog cmdlet can be used to create a new event log on a local or remote computer.

New-EventLog Cmdlet Syntax:

New-EventLog Cmdlet Argument List:

  • CategoryResourceFile: Specifies the path to the file that contains category strings for the source events. This file is also known as the Category Message File. The file must be present on the computer on which the event log is being created.
  • ComputerName: Creates the new event logs on the specified computers. The default is the local computer.
  • LogName: Specifies the name of the event log.
  • MessageResourceFile: Specifies the path to the file that contains message formatting strings for the source events. This file is also known as the Event Message File. The file must be present on the computer on which the event log is being created.
  • ParameterResourceFile: Specifies the path to the file that contains strings used for parameter substitutions in event descriptions. This file is also known as the Parameter Message File. The file must be present on the computer on which the event log is being created.
  • Source: Specifies the names of the event log sources, such as application programs that write to the event log. This parameter is required.

PowerShell New-EventLog Cmdlet:

Hope you have enjoyed this article. In the next blog post, we will discuss Write-EventLog CmdLet in PowerShell.

To Set more details on PowerShell, kindly follow below official documentation

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about?view=powershell-5.1

 

Leave a Reply