Reading Application and Services Log Win2K8R2

Soldato
Joined
4 Dec 2002
Posts
3,962
Location
Bourne, Lincs
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
 
Back
Top Bottom