I have an requirement where I need to create an custom event log on different server. I have the command to create the event log on local machine but need it for remote server. The command to create the event log on local machine is
powershell -command "if([System.Diagnostics.EventLog]::SourceExists('MySource')){Write 'Eventlog already exists'}else{[System.Diagnostics.EventLog]::CreateEventSource('MySource','MyCustomLog')}"
I want the same for the remote server.
Please paste the code if possible.
Thanks.