Powershell need to log when a file is created and owner

Feb 14 2015 9:38 PM
Hello!
I'm a nooby to powershell and trying to create a script that will montor a specific folder for new files.
The tricky part is collecting the owner (or who created it)... is this possible?
 
I've put some bits and pieces together and here's what I have.
I really need to log who created the files though (also)...
Thank you for any help provided!! 
 
========================================================== 

$folder = 'c:\test' 
$filter = '*.*' 
$fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $false;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
$name = $Event.SourceEventArgs.Name
$changeType = $Event.SourceEventArgs.ChangeType
$timeStamp = $Event.TimeGenerated
Write-Host "The file '$name' was $changeType at $timeStamp" -fore green
Out-File -FilePath C:\Users\BPW\Desktop\newfilelog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp by $owner"}
# Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted -Action {
# $name = $Event.SourceEventArgs.Name
# $changeType = $Event.SourceEventArgs.ChangeType
# $timeStamp = $Event.TimeGenerated
# Write-Host "The file '$name' was $changeType at $timeStamp" -fore red
# Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
# Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
# $name = $Event.SourceEventArgs.Name
# $changeType = $Event.SourceEventArgs.ChangeType
# $timeStamp = $Event.TimeGenerated
# Write-Host "The file '$name' was $changeType at $timeStamp" -fore white
# Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
=============================================================================