5

I would like to delete an event source in windows 2008.

I don't want to delete the log event, just the source.

How do I do that?

I don't find any command i PowerShell that does that.

PS > gcm *EventLog -CommandType cmdlet
CommandType     Name                 Definition
-----------              ----                                       ----------
Cmdlet                 Clear-EventLog                 Clear-EventLog [-LogName] <String[]> [[-Computer...
Cmdlet                 Get-EventLog                   Get-EventLog [-LogName] <String> [[-InstanceId] ...
Cmdlet                 Limit-EventLog                 Limit-EventLog [-LogName] <String[]> [-ComputerN...
Cmdlet                 New-EventLog                 New-EventLog [-LogName] <String> [-Source] <Stri...
Cmdlet                 Remove-EventLog          Remove-EventLog [-LogName] <String[]> [[-Compute...
Cmdlet                 Show-EventLog               Show-EventLog [[-ComputerName] <String>] [-Verbo...
Cmdlet                 Write-EventLog               Write-EventLog [-LogName] <String> [-Source] <St...
6

You can use Remove-EventLog to unregister one or more event sources:

Remove-EventLog -Source "My Custom Source"
Remove-EventLog -Source "ASource","Another one","CustomApp123"
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.