Announcement

Collapse
No announcement yet.

Reading Application and Services Log Win2K8R2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading Application and Services Log Win2K8R2

    Hi,

    We are trying to read print events from our Win2K8 print server by adapting a script we have been using for Win2K3.

    This is the code we are using to read the System event log

    Code:
    # Retrieve the event log and entries 
    $EventLog=[System.Diagnostics.EventLog]::GetEventlogs($servername) 
    $Systemlog = $EventLog |? {$_.log -eq 'System'} 
    $events = $SystemLog.Entries | Where {$_.eventid -eq 10 -AND $_.Source -eq "Print" -AND $_.Timegenerated -gt (Get-Date).adddays(-1) } | select Username, Timegenerated, Message
    However in 2k8R2 they have moved print events from the System log to PrintService within Applications and Services Logs\Microsoft\Windows\PrintService\Operational

    How can I read from this section as my google searching seems to be failing.

    Thanks

  • #2
    Re: Reading Application and Services Log Win2K8R2

    As outlined here:http://social.technet.microsoft.com/...-fa685514e9f7/

    Use the Get-WinEvent cmdlet
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: Reading Application and Services Log Win2K8R2

      Thanks for that, not sure how I missed that, but have noticed a problem with the event viewer, but will post in the 2008 thread as it is not to do with powershell.

      Thanks

      Dave

      Comment

      Working...
      X