Hi Pcstru,
That was very helpful!, I got the script working to this point. question now is - sorting by user is fine but how do I sort on the 'date' property as secondary after 'user' property since it's in the weird format below?:
Date NoteProperty System.String Date=Sat Dec 25 00:41:59 EST 2010
A second question which could make the sort unnecessary, the Group-object cmdlet is very nice as it groups each user, do you know how to set or retrieve the first entry of 'date' from the group-object?
$users = Import-Csv E:\PSDevScripts\auditlogbackup_1226*.csv #| Sort-Object User, Date #| group-object -property {$_.user)
$UserComp = "abcdef"
Foreach ($user in $users)
{
if ($user.user -ine $UserComp)
{
$userComp = $user.user
# will write user to output file
}
else
}