Windows 10: Using Write-Eventlog for remote event log returns OSWritingError

Discus and support Using Write-Eventlog for remote event log returns OSWritingError in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by AndrewG, Sep 7, 2016.

  1. AndrewG Win User

    Using Write-Eventlog for remote event log returns OSWritingError


    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

    available.

    At line:1 char:1

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

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

    + CategoryInfo : WriteError: Using Write-Eventlog for remote event log returns OSWritingError :)) [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.



    :)
     
    AndrewG, Sep 7, 2016
    #1
  2. Nigel_H Win User

    Event 3104 Search: "Enumerating user sessions to generate filter pools failed"

    With respect to the BSOD have you the eventlog message that occurred - in most BSOD now, Microsoft is writing the issue to the Event Viewer Log (I seem to recall it was the System log)

    In my cases to date the 3104 issue does not appear to be related to BSODs
     
    Nigel_H, Sep 7, 2016
    #2
  3. nancy3243 Win User
    Event Error Log

    PS C:\WINDOWS\system32> remove-EventLog -Source "Custom Log"

    remove-EventLog : The source name "Custom Log" does not exist on computer "localhost".

    At line:1 char:1

    + remove-EventLog -Source "Custom Log"

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

    + CategoryInfo : InvalidOperation: Using Write-Eventlog for remote event log returns OSWritingError :)) [Remove-EventLog], InvalidOperationException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.RemoveEventLogCommand



    PS C:\WINDOWS\system32> remove-EventLog -Source "CMS Application Log"

    remove-EventLog : The event log source 'CMS Application Log' cannot be deleted, because it's equal to the log name.

    At line:1 char:1

    + remove-EventLog -Source "CMS Application Log"

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

    + CategoryInfo : NotSpecified: Using Write-Eventlog for remote event log returns OSWritingError :)) [Remove-EventLog], InvalidOperationException

    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.RemoveEventLogCommand



    PS C:\WINDOWS\system32>
     
    nancy3243, Sep 7, 2016
    #3
Thema:

Using Write-Eventlog for remote event log returns OSWritingError

Loading...
  1. Using Write-Eventlog for remote event log returns OSWritingError - Similar Threads - Using Write Eventlog

  2. Event logs

    in Windows 10 BSOD Crashes and Debugging
    Event logs: Hello, My PC, Win 10, 64, crashes to a grey or black screen every few days or so. Tried re-installing win 10 from a stick. The error is: The WCSV3 service depends on the WAS which failed to start because the system cannot find the drive specified. Then in services, I...
  3. Event Logs

    in Windows 10 Drivers and Hardware
    Event Logs: Is there an event log that shows adding and removing dates of devices - computers, printers, etc from computer? https://answers.microsoft.com/en-us/windows/forum/all/event-logs/27a9283c-9d25-47d8-8e1b-0c04e7f4357e
  4. Event Logs Question

    in Windows 10 Ask Insider
    Event Logs Question: Does anyone know why when you write data to an excel file or word file, it shows firstly the file modified event and then the file deleted event right after (even though the file was not technically deleted it was just appended) in the event log? submitted by...
  5. Event 6008, Event Log.

    in Windows 10 BSOD Crashes and Debugging
    Event 6008, Event Log.: Hi , I found my PC in the restart condition and when I checked the logs I found Event 6008. Message displayed " The previous system shutdown at 17:45:34 on 10/09/2019 was unexpected". Log Name: System Logged 10/09/2019 18:21:15. etc.. Please check attached image....
  6. Event log

    in Windows 10 Drivers and Hardware
    Event log: On connecting via USB, an external drive, a message advised me to create an event log. HP PC Windows 10. It further stated that a message regarding this was being sent and to press 'Next'. Here I am, what now?...
  7. Windows Remote Management events logged on my computer. Why?

    in AntiVirus, Firewalls and System Security
    Windows Remote Management events logged on my computer. Why?: I was looking through the Windows 10 Event Viewer and noticed that Windows Remote Management has been logging events, even though I have never used it. Log entries include: Event ID 254 Activity Transfer Event ID 145 WSMan operation Enumeration started with resourceUri...
  8. event log

    in Windows 10 BSOD Crashes and Debugging
    event log: My event log shows numerous errors and warnings specifically for DistributedCom - this started happening around the 1st of November - should i do something? <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System> <Provider...
  9. Event Log error

    in Windows 10 Support
    Event Log error: Any idea what would be causing this? svchost (3972) Database recovery/restore failed with unexpected error -566. Many instances of this error in my event log. Running windows 10 pro with November update.... Thanks. 32625
  10. Missing Events in Event log?

    in Windows 10 Performance & Maintenance
    Missing Events in Event log?: Hi so I notice that sometimes when I do a system diagnostics report I get the message of missing events in event log. I do at times clear my events from event log after a long time but is this something to be concerned about? I did clear application and system event logs...

Users found this page by searching for:

  1. write-eventlog : the operating system reported an error when writing the event entry to the event log. a windows errorcode is not available.