Tuesday, May 28, 2013

Creating a Folder List for Varonis DatAdvantage




For some of the reports within Varonis DatAdvantage, such as 4b, Varonis has the ability to accept a list of folders to process.  This file consists of two fields separated b the pipe “|” character.  When a folder list is generated by the 4f report from within DatAdvantage, the fields are separated by a comma.  This is true even if the default separator is set to "|" in the control panel.  In addition, when a NetApp folder is enumerated the path is separated by the “/” character like a UNIX folder, however the Folder list only accepts the “\” character in the path.  Here is a Powershell script that will clean up the issues with the folder list generated by the 4f report.

$OutAll = @()
$Infile= Import-Csv "C:\VaronisPublic\Varonis Output\output.csv"
foreach($line in $Infile)
{
$OutLine = New-Object System.Object
$OutLine | Add-Member -type NoteProperty -Name FilerName -value $line.FilerName
$a = $line.AccessPath -replace "/", "\"
$OutLine | Add-Member -type NoteProperty -Name AccessPath -value $a
     
$OutAll += $OutLine  
}
$OutAll |Convertto-csv -Delimiter "|" -NoTypeInformation  | % { $_ -replace '"', ""} | out-file "c:\VaronisPublic\Varonis Output\outfile.csv" -fo -en ascii