Download here - Current version (4.07), posted 12/10
{4.5 is in alpha testing currently, link above is for the "released" version - 2/17/09}
This script will collect the following information: (By default)
-
Exchange server in the forest
-
Version of all servers
-
Current size of all EDB and STM files, per storage group (SG)
- Total mailbox size per SG
- Total item count per SG
- Current number of TLOGs sitting in the log directory for each SG
- Total size difference based on mailbox size per SG from the last run
- Total item count difference per SG from the last run
- Mailbox count difference per SG from the last run
- Size of each Store\DB EDB & STM, only collected on 1st run by default
- After 1st run, the script should be run as a scheduled task, see "Setting up a scheduled task" below.
- To get the most valid data make sure the script runs for at least 3 full business days, so if you start the scheduled job at 11AM on Tuesday let it run until after 11AM on Thursday.
- If you are running the script as a scheduled task, do not run it ad-hoc from the same location (after the 1st run), this will cause an inconsistent samples of data to be saved to the output file.
- No switches needed.
- Can be run from any system in the same forest as the Exchange servers. See "Other requirements" below.
How-To Videos:
Setting up EXCollect
Scheduling EXCollect Data Collection
Customizing EXCollect (100% optional)
Requirements:
- If collecting data from Exchange 2007 the script should be run on a system that has the Exchange 2007 management tools installed, it uses PowerShell and EMS to collect mailbox statistics.
- WMI is used for Exchange 2003, which works from most systems. Without E2k7 PowerShell & EMS, only database and storage group information will be collected.
- Administrator rights on the Exchange servers data will be collected from. See "Right needed" for more information.
Overview:
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 (HKLM\Software\Izzy.Org\EXCollect), 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.
For best results:
The script needs to be setup as a scheduled task, running as an account that has local admin rights on the Exchange servers (it uses the admin$ shares) it need to collect information from.
To get accurate results, the script needs to run for at least a 48 hour period, the more days of results the better.
The script gets the difference between the most recent\newest TLOG filename and the previous most recent\newest TLOG file. Using a hexadecimal based calculation it then returns the difference between the two, giving the # of TLOGs generated during that period.
So if you run it every hour, you will get a snapshot of the # of TLOGs at each run and the # of new TLOG generated during that period. You can then add up the # of new TLOGS to get the total per day, if ran for 24 hours. Or if you run it once every 24 hour to get the # of new TLOGs in a 24 hour period, but your can’t further analyze “slow” and “peak” times.
Setting up a scheduled task: (See this video)
- Create a new scheduled task
- Click Browse
- Enter the path of %systemroot%\system32\cscript.exe
- Change the name to "EXCollect"
- Select to run daily
- Change time 12:00AM and Every Day
- Enter an account that has local admin rights on the Exchange servers
- Check "Open Advanced properties..."
- Change Run to "%systemroot%\system32\cscript.exe <Path to EXCollect>\EXCollect.vbs"
- If the path to EXCollect has spaces in it enclose only that part in quotes
- Change the Start in to <Path to EXCollect>
- Click the Schedule tab
- Click the Advanced... button
- Change to repeat every 4 Hours and for a duration of 24 hours
- Script needs to run continuously for the entire period. Do not configure to only run certain days for example.
Right needed:
- Local admin rights on the Exchange servers.
- The admin shared (C$, etc) are used to get the current count of transaction logs.
- Read access to Exchange configuration container in the AD.
- Default AD permissions gives all users read access.
This spreadsheet will provide graphs on Exchange activity per day, day of week, item count growth, mailbox size growth, and a few other things. If you want to see data over time, you need to run the EXCollect script for this period of time and the paste the output data into Analyze EXCollect spreadsheet.
Variables\Options:
LimitToServers = List of servers that info should be collected from ONLY, comma separated.
DebugLevel = [1-4], 4 being the highest
StoreInfoFile = Output file for Store\DB info
UpdateStoreData = [True\
False] If store\DB file information should be written to
SGData.txt file with each run, by default data is only saved to in on the 1st run.
SGInfoFile = Storage Group info output file
MBInfoFile = Mailbox info output file
HandleErrors = [
True\False] For debugging purposes
DoPing = [
True\False] To attempt to contact systems without pinging them first; might be needed for some firewalled environments.
GetMBData = [
True\False] If mailbox statistics will be collected, slows script down. May take minutes verses seconds in larger environments.
WriteMBData = [True\
False] If mailbox details will be written to MBInfoFile
GetPerfData = [
True\False] If message flow related performance counter data will be collected and written to
EXCollect-PerfData.txt {New in 4.5}E2k7Counters = List of performance counters collected from Exchange 2007 servers {New in 4.5}
E2k7Counters = List of performance counters collected from Exchange 2007 servers {New in 4.5}
Functionality:
- Enumerates the AD to get the log path for all SGs
- Gets the last “newest” log from the a registry key for that SG (HKLM\Software\Izzy.Org\EXCollect\<Server>\<SG>)
- 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)
- Saves current store info (time stamp, EDB path, STM Path, EDB & STM size) in EXCollect-StoreData.txt
- This file is only updated on the 1st run by default. Set UpdateStoreData = True to have it updated on every run. In large environments this file can get to me several MBs after a few days.
- Saves current SG info (time stamp, Size, path, current TLOG count, oldest TLOG, newest TLOG, # new logs since last run) in EXCollect-SGData.txt
- Gets mailbox count, # of total items, and total size of all mailboxes per storage group
- Get performance counter data and saves it to EXCollect-PerfData.txt
- Compared the mailbox info from last run and save diff data to EXCollect-SGData.txt
TO DOs:
http://info.izzy.org/Technical/Scripting/EXCollect/Lists/Tasks/
Version History:
Created by Jason Sherry on 6/18/08 and I also maintain it and izzy.org.