Help appending how many times an event ID has occurred next to the unique Event ID.

Hello,
I am trying to figure out how to find how many times an event occurred and then append that next to the single  -unique Event ID.
The closest I can find is the Sort-Object Count but I can't figure out how to get that work within the below script.
Any help would be appreciated, the below script works already. but just doesn't have that Event ID count. 
Thank you for any help. 
Below is the
script to pull all Event Logs for each server, filter them to only display Warnings, Failures, and FailureAudits for Application, System, and Security logs and then remove all duplicate EventIDs so only 1 of each is shown. it then exports that info into a
.CSV per server.
param([string]$days= "31" )
$servers = @("Server1", "Server2" "Server3", "Etc")
$user = Get-Credential
#Set namespace and calculate the date to start from
$namespace = "root\CIMV2"
$BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
$store = "C:\Powershell\MonthlyMaintenance"
foreach ($computer in $servers)
$filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
Echo "Pulling Event Logs for $computer ..."
Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
sort eventcode -unique |
select Computername,
Logfile,
Type,
@{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
SourceName,
Message,
Category,
EventCode,
User |
Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
Echo "Done."

Unfortunately adding that to the script just outputs a bunch of jargon:
#TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData
ClassId2e4f51ef21dd47e99d3c952918aff9cd
pageHeaderEntry
pageFooterEntry
autosizeInfo
shapeInfo
033ecb2bc07a4d43b5ef94ed5a35d280
Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo
Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo
9e210fe47d09416682b841769c78b8a3
I did try adding it in various ways and removing the initial # Sort EventCode -unique | # and I just get the same jargon
Am I adding it in wrong some how? 
Thank you again for any help.
param([string]$days= "31" )
$servers = @("ComputerName")
$user = Get-Credential
#Set namespace and calculate the date to start from
$namespace = "root\CIMV2"
$BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
$store = "C:\Powershell\MonthlyMaintenance"
foreach ($computer in $servers)
$filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
Echo "Pulling Event Logs for $computer ..."
Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
sort eventcode -unique |
select Computername,
Logfile,
Type,
@{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
SourceName,
Message,
Category,
User,
EventCode | Select Name,Count | FT -auto|
Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
Echo "Done."

Similar Messages

  • How to find how many times a t code has been processed by a user

    How to find how many times a t code has been processed by a user I am not able to get the exact number from the ST03 or STAD/STAT transaction. I am requiring the specific number that this T code has been processed completely this many no of times for a specific period.

    You must be more precise with your question.
    How long is the time period which you want to check, few hours or several days or longer? And how many executions do you expect, 100, 10000 or millions?
    The STAD should help you, for the smaller numbers. There is no solution for the larger ones. Don't mix STAD and ST03, ST03 is aggregated STAD information
    and know only how often a transaction was executed in total.
    ST05 is no solution for your problem to much overhead, and yoou should trace only a short period.
    There is no tool to check usage of transactions in more detail because of privacy reasons.
    Siegfried

  • All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default s

    I don't know what happened. All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default search engine. I click the box 'do not ask me again' and it comes up EVERY TIME. I change things like I don't want history remembered, and when I reload FireFox again, it's back to the way it was BEFORE. EVERY SINGLE TIME. I don't know why this is happening, or how to fix it. What do I do??

    I do not want to download another virus program.. I do not believe it is a virus. I am running the full version of Norton 360 and it is doing a daily scan. I have Windows 7, 64 bit OS.
    This is very irritating !! If I wanted Yahoo I would ask for it !

  • Am I able to find out how many times my ICloud account has been accessed?

    Am I able to find out how many times my ICloud account has been accessed?

    I'm afraid iCloud doesn't provide access logs.

  • Keeping count of how many times a case structure has been entered.

    I have a "Case" structure (when a button is pressed, it is "case True").
    I want to keep track of how many times this "case True" has been entered.
    How can I do this?
    Solved!
    Go to Solution.

    For that you need to have a shift register or a feedback node and keep counting whenever the case structure case is executed the count will be increased by one see the attached snippet.
    Good Luck
    The best solution is the one you find it by yourself
    Attachments:
    CaseStructure count.png ‏10 KB

  • Can I see how many times a shared album has been viewed?

    I primarily use Revel to share photos of events since the files get too big to email more than 2 at a time.  Usually, there is a very limited group of people that would be interested but the link to one album was shared on Facebook and I'm curious to see if many people viewed that album.  Is there a way to see how many times the album has been viewed?

    Use your account credentials to log on to iTunes Connect. Or use those same credentials with one of the 3rd party app reports management tools such as AppViz, AppAnnie, etc.
    iTunes Connect
    https://itunesconnect.apple.com/ 

  • Count how many times a Orchestrator runbook has run in last 30 days

    Hi
    Please could someone help me with a sql query that could help me do a count on how many times a runbook has run or been executed in the last 30 days ?
    Thanks

    Hi,
    here is your SQL Query
    select Name, count(policies.UniqueID) as Count from Policies
    inner join POLICYINSTANCES on policies.UniqueID=POLICYINSTANCES.PolicyID
    where POLICYINSTANCES.TimeEnded > DATEADD(mm,-1,GETDATE())
    group by name order by Count
    Seidl Michael | http://www.techguy.at | twitter.com/techguyat |
    facebook.com/techguyat |
    youtube.com/techguyat

  • How many times can you download a free trial, on the same computer?

    about how many times are you allowed to download the same free trial software on the same computer?

    You can install a trial once on the same computer. After the trial period ends, you'll need a serial number (in other words, a purchased product) to continue using it on the same computer.

  • HT5071 How can I see how many times my free book has been downloaded?

    I would like to know how many people have downloaded my free ibook, but I can't find that information.  I am a complete novice at this, so please give detailed answers.  For example, I do not know how to log into my ibooks account.  Thanks.

    Use your account credentials to log on to iTunes Connect. Or use those same credentials with one of the 3rd party app reports management tools such as AppViz, AppAnnie, etc.
    iTunes Connect
    https://itunesconnect.apple.com/ 

  • Any way of knowing how many times a purchased playlist has been burnt?

    Is there any way of telling how many playlist burns you have left of the 7 allowed for purchased songs (playlists)?
    -Frankie

    hi,
    use STAD transaction.

  • How many times do you listen to an album before the "___ listens to this" when friends see it?

    Hi, Sorry if I got the wrong board, I wasn't sure where to post this. Does anyone know how much you listen to something before Spotify tells your friends about it? Weirdly, when I'm browsing on a friend's account, a bunch of albums I listen to quite infrequently have my face on them, whereas some of the ones I listen to all the time don't seem to. This doesn't really bother me, but I was wondering if anyone knew any more about it :) Thanks

    Latest no speed change after 24 hours not one tiny bit - so much for it increasing gradually to the old maximum.
    Stats
    BT speed check gave me Downstream 468  IP Profile 506
    Upstream 929 IP Profile 1135.
    Much the same as I have got for the past week and also get on either router and still get after a supposed profile reset.
    Checks on mybroadbandspeed.co.uk which I have been keeping for 12 months show its down from more than 7 meg to 400k.
    Anyone know why the DSL link shows a better uplink than downlink - Faulty DSLAM ?
    Router stats? ADSL ( Belkin)
    ADSL
    Language
     Type
    Current Langugae
    English
     Status
    No Defect
    Available Langugaes
    English  Deutsch  Français  Español
    Downstream   
    Upstream
     Data Rate(Kbps)
             574         
             1103
     Noise margin (dB)
             31.3         
             6.1
     Output power (dBm)
             0.0         
             12.7
     Attenuation (dB)
             30.0         
             14.6

  • How many times can Windows 7 be syspreped, what is the official Answer?

    Hey everyone, can somebody out there give me the straight answer on this?  What is the official number windows 7 can be syspreped?  I am looking to build my reference images, but every time I do this I have to 150+ updates each time.  Can
    I get way with just updating the reference image every time?  I have heard there is a Max number of times you can do this before you have to rebuild.  
    We are running WIndows 7 Enterprise with KMS.
    Also will this apply to 8.1?
    Thanks

    Hi,
    Sysprep limitations are due to the windows activation process.
    There is no limit to the number of times that the Sysprep command can run on a computer. However, the clock for Windows Product Activation begins its countdown the first time Windows starts. You can use the sysprep /generalize command to reset Windows Product
    Activation a maximum of three times. After the third time that you run the sysprep /generalize command, the clock can no longer be reset.
    Assuming you are using a KMS: We recommend that KMS clients use the sysprep /generalize command where the value of the SkipRearm setting is equal to 1. After capturing this image, use the sysprep /generalize command, where the value of the SkipRearm setting
    is equal to 0.
    Karen Hu
    TechNet Community Support

  • How many times can you type in your password on the restrictions

    I need help

    You can install a trial once on the same computer. After the trial period ends, you'll need a serial number (in other words, a purchased product) to continue using it on the same computer.

  • Reinstall iTunes - will my "how-many-times-played" statistics be saved?

    I am about to reboot my computer. I will delete everything and then reinstall windows, iTunes etc. Of cause i will make a copy of all my mp3 tracks, but is it possible for me to save the statistics of how many times my songs have been played? Is the statistics saved in some kind of file in the iTunes folder or something like that so i could copy that too and when i reinstall it then just paste and my statistics will be saved?
    I hope you can help me
    Regards from
    Simon Littauer

    hmmmm. okay, there's some info on that in this Buegie post:
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=2639135

  • How many times can a podcast be heard /$$ .imac space

    I understand how many times a podcast can be heard ( based on the size of the podcast ) per unit of space I buy but imac doesn't tell you how much it costs to buy extra units if you want to upgrade to more storage space, ~~ without giving your credit card number first and purchasing the original storage space for $99.
    I can't really figure out if it is worth purchasing the space. my first podcast is 67 MB right now with one GB of storage / transfer units, that podcast can only be heard one time.
    so I have garage band and can make podcasts but don't have the information I need to move forward to publish my podcast.

    I believe your talking about .Mac account that has I think 10Gb of storage. 10 gigs is a lot of podcast nothing to worry about for a few years. As for how much monthly bandwidth you get I don't know but you probably would have to be in the thousands of downloads a month before you come up to any restrictions.

Maybe you are looking for

  • How can i get a refund on the icloud storage i have just purchased?

    i have just recently purchased extra storage on icloud , on the email i recieved it says i can get a full refund within 15 days of purchase, i went to apple store and they said to contact online , im so confused on how to communicate to solve this si

  • SG500's with seperate DHCP device

    I have (2) Cisco SG500's, native stacked using the S1/S2 ports. The first switch IP is still 192.168.1.254. The manufacturer of the equipment I am installing requires a TP-Link wireless router functioning as DHCP server for the devices (50 plus). Wha

  • Integration Call Manager with Microsoft's tools

    Hello, My costumer has call-manager 5.1 and Cisco Unity 5.0 (voice e-mail only) working perfectly on his company. Besides, he has Microsoft Outlook 2007 and MS-Office Communicator with presence server. He wants to use MS's tools integrated with Cisco

  • J3d source needed...

    Hello everybody, my question is pretty simple : Does anyone here know where i could find the "javax.media.j3d.BehaviorRetained" source code? I've just upgraded from j3d 1.2 to j3d 1.3.1 and my old app source code generates a new nullException which s

  • CS6 Lighting Effects from Filter Render

    I know that 3d is not available with the basic creative cloud photoshop only.  But my oil paint would not work and they said it is the graphics card.  i contacted my laptop manufacturer and they said it is the latest and updated version for my laptop