Powershell get win event FilterHashTable for a computername

Ok I am trying to find a account name by the last 30 days in the message box.
Our security logs go back so long and have co many log on and log off events piping it out to a where statement is unbelievable slow.
The only solution is to filter it right in the hash table but I cant make it work.
Here is what I have

Get-WinEvent -ComputerName MS01ADC  -FilterHashTable @{Logname='Security';Starttime=$([datetime]::Today.AddDays(-30))}  

Open in new window

Lets say I want a Account Name in the message box to match WS42south how can I do that with out resorting to what I have below since it takes a hour or more.   There must be a way to do it with out a pipe.  


Get-WinEvent -ComputerName MS01ADC  -FilterHashTable @{Logname='Security';Starttime=$([datetime]::Today.AddDays(-30))}   |? {$_.message -match "WS42south "}

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try the following.  There's only so much matching you can do inside the message without further processing.
Get-WinEvent -ComputerName MS01ADC -FilterHashTable @{Logname='Security'; Starttime=$([datetime]::Today.AddDays(-30)); data = "WS42south"}

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GCPSlanopsAuthor Commented:
Perfect thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.