I try to edit a script for collect result of endpoint backup installed on different workstation.
I try to use this script but the result is SERVER CONNECTION ERROR.
Someone has idea how to fix this problem? or know an other way to do the same thing?
Thak you
Andrea
Code: Select all
" Start to Veeam EPB connect to servers..."
foreach($Server in $VebServers)
{
$jobtemp = @()
try
{
$jobtemp += Get-EventLog -LogName "Veeam Agent" -ComputerName $Server.Destination -Newest 3 | where {$_.message -like "*Success*" -or $_.message -like "*Fail*" -or $_.message -like "*Warning*" }
foreach($jobtemp1 in $jobtemp)
{
#$MessageTemp1 = "Warning" # This is a work-around. All messages that is not Success or Fail become a Warning
if($jobtemp1.Message -like "*Success*" )
{
$MessageTemp1 = "Success"
}
else
{
$MessageTemp1 = "Failed"
}
else
{
$MessageTemp1 = "Warning"
}
$jobSrvs1 += New-Object -TypeName psobject -Property @{jobname=$jobtemp1.Source; result=$MessageTemp1; 'Desc'=$Server.Desc + " (" + $Server.Destination + ")"; 'Date'=$jobtemp1.TimeGenerated}
}
" " + $Server.Desc + " Processed Correctly..."
}
catch #Server connection error
{
$jobSrvs1 += New-Object -TypeName psobject -Property @{jobname="SERVER CONNECTION ERROR!"; result="---"; 'Desc'=$Server.Desc + " (" + $Server.Destination + ")"; 'Date'="" }
" Error processing " + $Server.Desc + " !!"