Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to get ComputerName in Powershell Get-Eventlog

In Security section in Event Viewer, there is a column named "Computer".

I am using powershell to retrieve "all event ID 100" as of yesterday and display columns "event ID" and "computer".

Get-EventLog Security -After "2016-08-25 08:08:08" | Where-Object { ($_.instanceid) -eq 100 } | select-object "computer", "instanceID"

However, it only shows blank records for Computer column.

Please help. Thank you.

like image 666
York Mak Avatar asked Dec 06 '25 07:12

York Mak


1 Answers

Try it with MachineName like so

... select-object "MachineName", "instanceID"  

You can find that out when piping your objects to

Get-EventLog ... | Get-Member 

where you will find a property MachineName

like image 173
DAXaholic Avatar answered Dec 08 '25 11:12

DAXaholic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!