Logging information to your event log is easy when using Write-Eventlog. You will just need to register your own event source first by using New-Eventlog. This . New-Eventlog can also be used to create your very own event logs. This will cCreatinge a new event log called "LogonScripts," means you must . Just makebe sure toyou have full Admin privileges when you call this line:
New-EventLog -LogName LogonScripts -Source ClientScripts
Once done, you can write your entries, and no special privileges are needed:
Write-EventLog LogonScripts -Source ClientScripts -Message 'Test Message' -EventId 1234 -EntryType Warning