title: Create custom event log on remote server with PowerShell
body: <p>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</p>
  
  <pre><code>powershell -command "if([System.Diagnostics.EventLog]::SourceExists('MySource')){Write 'Eventlog already exists'}else{[System.Diagnostics.EventLog]::CreateEventSource('MySource','MyCustomLog')}"
  </code></pre>
  
  <p>I want the same for the remote server.</p>
  
  <p>Please paste the code if possible.</p>
  
  <p>Thanks.</p>