Hi,
I tried to modify in powershell, Can you please confirm will it work or not
$date = Get-Date -Format "yyyy-MM-dd"
$rpt_file ="c:\temp\backup_rpt_"+$date+".csv"
ALARM_TRESHOLD=84000
RUNTIME=0
bpdbjobs -most_columns | awk -F "," ' $3 ~ /^1$/ { print } ' | awk -F "," ' $2 ~ /^0$/ { print } ' | awk -F "," '{ print $1, $3, $6, $7, $10 }' | while read PID STATE SCHEDULE CLIENT RUNTIME
do
if [ RUNTIME -gt ALARM_TRESHOLD ]
then
echo "Job ${PID} ${CLIENT} ${SCHEDULE} runtime is ${RUNTIME}. It's exceeded runtime treshold of ${ALARM_TRESHOLD} "
fi
done
# Sending email
set $SMTPport=Port number
set $Mailto=xyz.com
set $Mailfrom=abc.com
set $Mailsubject="Long Backup Report"
set $AttachmentDir=" c:\temp"
set $AttachmentFile_UK=$rpt_file
Send-MailMessage -SmtpServer "X.X.X.X" -From "abc.com" -To "xyz.com" -Attachments $rpt_file -Subject "Long Backup Report"