Script: Get transaction log count (EXCollect)


7/21 Update: 

I’ve created a wiki page for this script: http://info.izzy.org/Wiki/EXCollect.aspx go here for the latest info.  I’ve also renamed the script to "EXCollect" 🙂

 

At my new company (Mimosa Systems) we have a sizing XLS that we use to estimate the storage and IOPS requirements for our (archiving) product.  The best\simplest metric we have found on growth & amount of data is TLOG count (at least the best metric with minimum impact).  Asking the customers for this count has been problematic, so I decided to script a better solution.

 

The script auto discovers all storage groups in the forest and then uses a basic DIR command to get the count.  It then keeps track of the last TLOG for each SG from its previous run, in the registry, and calculates the # of new logs since the last run.  The results, with additional info on store size, path, etc, are saved to a tab delimited TXT files, which makes creating a Pivot table chart & graph of the data pretty easy.  The script needs to setup as a scheduled tasks, for best results, running as an account that has local admin rights on the Exchange server (it uses the admin$ shares).

 

Anyways, here’s the script:
EXCollect.vbs : http://info.izzy.org/Technical/Scripting/Documents/Forms/DispForm.aspx?ID=42

 

If anyone out there has comments or additions or want to assist on some of the To Do’s feel free to ping me.

 

This script would also be usefull for collecting TLOG data as input for the updated Exchange 2007 storage caculator.

 

Parts of this script came initially from a script originally posted by Michael B. Smith to his blog (http://theessentialexchange.com/blogs/michael/) on 7/11/06.  Original script.

Mostly rewritten by Jason Sherry on 6/18/08 to do the following:

  1. Enumerates the AD to get the log path for all SGs
  2. Gets the last “newest” log from the a registry key for that SG (HKLM\Software\Mimosa\PS Tools\<Server>\<SG>)
  3. Calculates the difference between the last newest log file (from registry) and the current newest (from file system), if there is no newest log value in registry it uses the oldest log file (from file system)
  4. Saves current store info (time stamp, EDB path, STM Path, EDB & STM size) in StoreData.txt
  5. Saves current SG info (time stamp, Size, path, current TLOG count, oldest TLOG, newest TLOG, # new logs since last run) in SGData.txt
This entry was posted in Exchange and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s