PowerShell script exchange
dannyr1992
Lurker
Posts: 1 Liked: never
Joined: Feb 27, 2019 10:05 am
Full Name: Danny Robinson
Contact:
Post
by dannyr1992 » Feb 27, 2019 10:09 am
this post
Hi ,
I am using a PRTG script written by another source.
I am trying to modify some of it . I understand its kind of not directly Veeam but it talks to the Veeam cmdlet.
Does anyone know how i can exclude the weekends from a search on failed backups for example.
Code: Select all
$seshListBk2 = @($allSesh | Where-Object{($_.CreationTime -ge (Get-Date).AddHours(-24)) -and $_.JobType -eq "Backup"})
This currently checks over 24 hours but i would like saturday and sunday to be excluded from it.
veremin
Product Manager
Posts: 20400 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Feb 27, 2019 3:39 pm
this post
Just check in the beginning of the script whether the current day is Sunday or Monday and proceed or not to the given line, based on the results. Thanks!
Users browsing this forum: No registered users and 14 guests