Hello, with y’our help i have done this little script :
# Declaration des Variables #
$PSLP = "F:\admin\SLP-Name.txt"
$FileBacklog = "f:\admin"
$Backlog = @()
$FileSLP = Get-Content $PSLP
cd F:\Veritas\NetBackup\bin\admincmd
##### Corps du script #####
# Création du fichier des BackupID présent dans les SLP #
$Backlog = ForEach ($slp in $FileSLP){
.\nbstlutil.exe stlilist -l -lifecycle $slp -image_incomplete | find /i " I "
}
# Exécution des commandes de Cancel et Expiration des BackupID #
$Backlog | Out-File "$FileBacklog\Backlog.txt"
$content = Get-Content "F:\admin\Backlog.txt"
ForEach ($ID in $content){
$value = ($ID -split '\s+')[2]
.\nbstlutil.exe cancel -backupid $value
.\bpexpdate.exe -backupid $value -d 0 -force
}
.\bpimage.exe -cleanup -allclients
.\nbdelete.exe -allvolumes -force
# Il faudra ensuite se connecter sur l'Appliance et taper les commandes suivantes :
# .\crcontrol.exe --processqueueinfo
# .\crcontrol.exe --processqueue
# .\crcontrol.exe --processqueueinfo, ceci tant que la valeur de "Busy :" est "on"
# .\crcontrol.exe --compactstart
$SLP = (.\nbstlutil.exe report) | Export-Csv "f:\admin\slp.csv" -Delimiter " " -Encoding UTF8
I have manually create the SLP-Name.txt file, i would like to create it when i execute the script.
To have the SLP, i need to run this command “.\nbstlutil report” Netbackup Command"
I try with this code :
.\nbstlutil report | Out-File -LiteralPath f:\admin\slp.txt
$csv = Get-Content "f:\admin\slp.txt" | Export-Csv -Path "f:\admin\slp.csv" -Delimiter "," -Encoding UTF-8
But the content of the csv is not waht i have expected :
PS F:\Veritas\NetBackup\bin\admincmd> Get-content -Path "F:\admin\slp.csv"
#TYPE System.String
"PSPath","PSParentPath","PSChildName","PSDrive","PSProvider","ReadCount","Length"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","1","0"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","2","32"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","3","41"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","4","24"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","5","33"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","6","0"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","7","75"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","8","79"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","9","79"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","10","79"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","11","0"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","12","79"
"F:\admin\slp.txt","F:\admin","slp.txt","F","Microsoft.PowerShell.Core\FileSystem","13","0"
Have you an idea why ?
Thx again for your help