> And how can i schedule this code to run each day
Save it as a .ps1 file, set up a scheduled task to run the version below like this:
PowerShell.exe C:\wherever\script.ps1
I've added a line to the top to ensure the Quest CmdLets load, they will need to be installed on the system running the script.
Chris