I have a powershell script that works on Windows 7 with powershell versions 3, 4, and 5. The same script ran on Windows 10 the command gives me a OSWriting error:

PS C:\WINDOWS\system32> Write-EventLog -LogName ClearLoftwareLabels2 -Source Scripts2 -ComputerName COMDCLKD01 -EventId 1 -Message Test

Write-EventLog : The operating system reported an error when writing the event entry to the event log. A Windows error code is not


At line:1 char:1

+ Write-EventLog -LogName ClearLoftwareLabels2 -Source Scripts2 -Comput ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : WriteError: (:) [Write-EventLog], Exception

+ FullyQualifiedErrorId : OSWritingError,Microsoft.PowerShell.Commands.WriteEventLogCommand

The command is writing to a Windows 12 server with a custom log file. The Windows 7 users have been using this for several months with out issue. We are starting to roll out Windows 10 and we are seeing this.

I have read plenty of blogs and various articles with no success at finding information around Windows 10 and security to remote event logs.

The full command is:

Write-EventLog-LogNameClearRunAwayLabels-SourceScripts-Message"This entry will cause a scheduled task to run for clearing print jobs."-EventId3-EntryTypeInformation-ComputerName ???????

Looking for ideas or solution to why I am getting a write error, if the account or command can not access the reg to find the eventlog another error would appear, therefore it found the log but can not write. From Win 10 I can issue Get-Eventlog and read the entries.