###ROBOCOPY VHDX VEEAM OVH VERSO TNAS UFFICIO###

net use Z: /delete

Start-Sleep -Seconds 5

net use Z: \\10.74.82.201\veeam-ovh-storage $env:ZPass /user:egw-tscale-01\veeamovh

Start-Sleep -Seconds 5

#definisco file di log tramite hostname locale
$hostname = hostname
$logFile1 = "C:\Steamware\Logs\VeeamBackupRobocopy" + $hostname + ".log"
$logFile2 = "C:\Steamware\Logs\VeeamConfigRobocopy" + $hostname + ".log"

#cartella1 di origine
$sourceFolder1 = "B:\Backups\Backup Job WDC"

#cartella2 di origine
$sourceFolder2 = "B:\Backups\VeeamConfigBackup"

#cartella1 di destinazione
$destFolder1 = "Z:\VEEAM-WDC\Backup Job WDC"

#cartella2 di destinazione
$destFolder2 = "Z:\VEEAM-WDC\VeeamConfigBackup"

#eseguo copia cartella 1
robocopy $sourceFolder1 $destFolder1 /mir /mt /tee /log:$logFile1

#eseguo copia cartella 2
robocopy $sourceFolder2 $destFolder2 /mir /mt /tee /log:$logFile2

Start-Sleep -Seconds 5

net use Z: /delete