Soldato
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
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
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