PowerShell script exchange
Post Reply
dannyr1992
Lurker
Posts: 1
Liked: never
Joined: Feb 27, 2019 10:05 am
Full Name: Danny Robinson
Contact:

Powershell PRTG script

Post by dannyr1992 »

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: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell PRTG script

Post by veremin »

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!
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests