Thank you both, this is exactly what I was looking for!
Last question - how can I format the output into an html file or csv that I can mail after the script runs?
Thank you both, this is exactly what I was looking for!
Last question - how can I format the output into an html file or csv that I can mail after the script runs?