I have this PowerShell query listed below and I require the headers to be machine, path, filewalkmethod
$fs = Get-FileServer
foreach ($s in $fs) {
foreach ($share in $s.Volumes) {
($s.Servername, $share.Share, $share.FileWalkMethod) -join "," |
Out-File -Append D:\data\splunk\otl_varonis\otl_varonis_monitoring.csv
}
}
Sample output:
nas01e,E$,Windows
Updated Query I'm using:
Import-Module -Name VaronisManagement
Connect-Idu
$fs = Get-FileServer
foreach($s in $fs){
$s.Volumes | Select-Object @{n='ServerName'; e={$s.ServerName}}, Share, FileWalkMethod |
Export-CSV D:\data\splunk\otl_varonis\otl_varonis_monitoring_test.csv
-NoTypeInformation -NoClobber }