One of the key components to many of my scripts is to have it produce either a transcript or CSV or both and send out an email with that attached. You can take and modify this code to make files for input into a Database or to simply send out a “I ran a script” email.