Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Security Log

$
0
0

I'm trying to get information from a security log.  This is what I have so far:

$EDate = Get-EventLog -LogName Security -InstanceId 4732 -Newest 1 -computername $PC | select-object timegenerated

This gives me the data I need, but when I export this data in .csv this is a sample of the output I get:

@{TimeGenerated=11/24/2014 8:45:26 AM}

Is there a way I can just get the date and time without the "@{TimeGenerated=" ???

I've tried using {$_.Split("`n")[1].Trim().replace("@{TimeGenerated","")} but haven't had any luck on getting commands like this to work. 


Viewing all articles
Browse latest Browse all 6937

Trending Articles