$(Date) variable math
Stephen Reece
Hello,
I am trying to create a dynamic group that looks in a specified folder to see if there are any file of a specific type (in my case, *.mrimg) that are newer than 7 days. The gist is to see if automated backups on a client are failing. Is it possible to use the $(Date) variable in a custom variable (e.g. @(OlderThanAWeek) = $(Date)-7days) and then subtract some amount of time from it?
Thanks!
0
Comments
There's not a way to do this natively, but you could automate creating the custom variable using the PDQ Inventory cli and PowerShell. Set up a scheduled task to run at midnight, to update the variable using something like this:
When ran right now, it sets my 7daysago custom variable to 2018-10-05
However, I'm not 100% sure how you're wanting to use this date, but hopefully this helps you get started!