Direct Inward Dialing: +1 408 916 9892
The following is a comparison between monitoring a folder for new files with Windows PowerShell and ADAudit Plus:
$watcher = New-Object System.IO.FileSystemWatcher
Example: If the folder has subfolders that need to be monitored, then assign the IncludeSubdirectories property.
$watcher.IncludeSubdirectories = $true
$watcher.Path = 'C:\FolderThat NeedsMonitoring' $watcher.EnableRaisingEvents = $true
$action = { $path = $event.SourceEventArgs.FullPath $changetype = $event.SourceEventArgs.ChangeType Write-Host "$path was $changetype at $(get-date)" }
PS > Register-ObjectEvent $watcher 'Created' -Action $action
PS> Get-EventSubscriber
The details you can find in this report are: