Logging Long Scripts

Just a short word of advice. If you use a lot of long scripts to automate processes like account creation and termination, copious log files are insanely helpful for troubleshooting unexpected output. Here’s a sample set of log entries from the user termination script that I created for our help desk:

201308141415-firstname.lastname:: ==================================================
201308141415-firstname.lastname:: 201308141415 – Termination Script for firstname.lastname executed by helpdesk.user.
201308141415-firstname.lastname:: Script version 2013.05.07
201308141415-firstname.lastname:: UserData:Name : Firstname Lastname
PrimarySMTPAddress : flast@domain.com
ParentContainer : domain.com/Employees/location
201308141415-firstname.lastname:: firstname.lastname hidden from the GAL.
201308141415-firstname.lastname:: firstname.lastname is a member of the following Distribution Groups:
201308141415-firstname.lastname:: Mailbox export request for firstname.lastname placed in queue.
201308141415-firstname.lastname:: Archive mailbox export request for firstname.lastname placed in queue.
201308141415-firstname.lastname:: firstname.lastname disabled.
201308141415-firstname.lastname:: Accidental delete protection removed.
201308141415-firstname.lastname:: firstname.lastname renamed to Terminated 20130814 firstname.lastname.
201308141415-firstname.lastname:: firstname.lastname moved to Terminated Accounts OU.
201308141415-firstname.lastname::
201308141418 – Termination Script for firstname.lastname exiting.
201308141415-firstname.lastname:: ==================================================

Leave a Reply

Your email address will not be published. Required fields are marked *