Petri IT Knowledgebase Forums
 

Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri IT Knowledgebase Forums > Windows Scripting > Powershell
Petri.co.il is happy to award auglan the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri IT Knowledgebase Forums Search Todays Posts Today's Posts Mark Forums Read

Notices

Reading Application and Services Log Win2K8R2

Reading Application and Services Log Win2K8R2

this thread has 2 replies and has been viewed 905 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th August 2012, 11:59
Dave_Lincs Dave_Lincs is offline
Junior Member
It's not a coincidence
 
 Join Date: Apr 2008
  6 month star 12 month star
 Posts: 145
 Reputation: Dave_Lincs is on a distinguished road (10)
Default 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  
Old 8th August 2012, 12:16
Ossian Ossian is offline
Administrator
 
 Join Date: Nov 2003
  6 month star 12 month star
 Location: Bonnie Scotland
 Posts: 15,138
  Send a message via Skype™ to Ossian
 Reputation: Ossian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud ofOssian has much to be proud of (1300)
Default 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 **
  #3  
Old 8th August 2012, 13:16
Dave_Lincs Dave_Lincs is offline
Junior Member
It's not a coincidence
 
 Join Date: Apr 2008
  6 month star 12 month star
 Posts: 145
 Reputation: Dave_Lincs is on a distinguished road (10)
Default 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
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a new Win2K8R2 DC to an existing Win2K3 site JDMils Active Directory 1 25th July 2012 11:43
Ex2003 Problem post Win2k8R2 install wolfr1 Exchange 2000 / 2003 11 17th November 2011 03:10
windows 2008 sp2 terminal services application issue pledesma72 Terminal Services 4 7th December 2009 03:50
Terminal Services 2003 - Application Server Mode Vlad Tomsa Terminal Services 10 19th December 2008 14:53
Terminal Services Application Analyzer Beta yuval14 Terminal Services 0 12th July 2008 21:54


All times are GMT +3. The time now is 20:26.

Steel Blue 3.5.4 vBulletin Style ©2006 vBEnhanced
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri