none
Get-EventLog "Microsoft-Windows-DNSServer/Audit" Error RRS feed

  • Question

  • Hello All, 

    I am trying to get the logs from "Microsoft-Windows-DNSServer/Audit", but I am getting an error saying it does not exist even though with Get-WinEvents - List Log I am seeing the log exists.  What am I missing?

    Thank you, 

    David D.

    Tuesday, August 9, 2016 6:52 PM

Answers

  • Looks like you've inserted a - character in there that's not in the name in your list.

    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Mike Laughlin Tuesday, August 9, 2016 7:11 PM
    • Marked as answer by David_De Tuesday, August 9, 2016 8:01 PM
    Tuesday, August 9, 2016 7:01 PM
    Moderator

All replies

  • Looks like you've inserted a - character in there that's not in the name in your list.

    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Mike Laughlin Tuesday, August 9, 2016 7:11 PM
    • Marked as answer by David_De Tuesday, August 9, 2016 8:01 PM
    Tuesday, August 9, 2016 7:01 PM
    Moderator
  • Good catch, even when I copy from the original Get-WinEvent and paste it in there, I get the error still.

    Get-EventLog -ComputerName ServerName -LogName Microsoft-Windows-DNSServer/Audit -Newest 5

    Get-EventLog : The event log 'Microsoft-Windows-DNSServer/Audit' on computer 'ServerName' does not exist.
    At line:1 char:1
    + Get-EventLog -ComputerName ServerName -LogName Microsoft-Windows-DNSS ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-EventLog], InvalidOperationException
        + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetEventLogCommand

    Tuesday, August 9, 2016 7:58 PM
  • Ok here was the errors, I need to use the Get-WinEvent and not Get-EventLog.  Also leave the extra "-" out of it.

    Thank you, 

    David D.

    Tuesday, August 9, 2016 8:01 PM