PowerShell Logo Small

New-EventLog



This is the built-in help made by Microsoft for the command 'New-EventLog', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a new event log and a new event source on a local or remote computer.

SYNTAX


New-EventLog [-LogName] <String> [-Source] <String[]> [[-ComputerName] [<String[]>]] [-CategoryResourceFile [<String>]] [-InformationAction {SilentlyContinue | Stop |
Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] [-MessageResourceFile [<String>]] [-ParameterResourceFile [<String>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


This cmdlet creates a new classic event log on a local or remote computer. It can also register an event source that writes to the new log or to an existing log.


The cmdlets that contain the EventLog noun (the Event log cmdlets) work only on classic event logs. To get events from logs that use the Windows Event Log technology in
Windows Vista and later versions of Windows, use Get-WinEvent.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=293885
Clear-EventLog
Get-EventLog
Limit-EventLog
New-EventLog
Remove-EventLog
Show-EventLog
Write-EventLog

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>new-eventlog -source TestApp -logname TestLog -MessageResourceFile C:\Test\TestApp.dll



This command creates the TestLog event log on the local computer and registers a new source for it.










-------------------------- EXAMPLE 2 --------------------------

PS C:\>$file = "C:\Program Files\TestApps\NewTestApp.dll"
PS C:\>new-eventlog -computername Server01 -source NewTestApp -logname Application -MessageResourceFile $file -CategoryResourceFile $file



This command adds a new event source, NewTestApp, to the Application log on the Server01 remote computer.

The command requires that the NewTestApp.dll file is located on the Server01 computer.