Hi,
Still very much a noob with Powershell, but managing to fumble my way through. I’m having some difficulty when it comes to writing some scripts when I want to look at a particular attribute of an object. For example, I have been looking at a script online that looks at the event log for the last logged on user. It returns two attributes, Username and LoginTime. To put it in context;
$Date = [DateTime]::Now.AddDays(-14)
$Date.tostring("MM-dd-yyyy"), $env:Computername
$eventList = @()
Get-EventLog "Security" -After $Date `
| Where -FilterScript {$_.EventID -eq 4624 -and $_.ReplacementStrings[4].Length -gt 10 -and $_.ReplacementStrings[5] -eq "dmorrison"} `
| foreach-Object {
$row = "" | Select UserName, LoginTime,
$row.UserName = $_.ReplacementStrings[5]
$row.LoginTime = $_.TimeGenerated
$eventList += $row
}
$eventList
My question is, how can I find a list of all available attributes for an object?
Any help would be appreciated.
TIA
Doug