Home > Microsoft Exchange Tips > Exchange Server Administration Tips > VBScript helps you keep an eye on the Private Store
Exchange Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

EXCHANGE SERVER ADMINISTRATION TIPS

VBScript helps you keep an eye on the Private Store


Will Schmied, Contributor
10.11.2004
Rating: -3.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


I'm a big fan of automation -- I think most administrators who have had the opportunity (and the time) to script would probably agree.

The time spent scripting is usually paid off many times over when you get the script working and saving you time. The script example below is certainly nothing earth shattering, or even revolutionary for that matter, but it did provide an easy-to-use method to accomplish a task that concerns me: Keeping an eye on the Exchange Private Store size.

An organization I know was in the process of making final plans for a large corporate-wide migration. They were moving from a Windows NT 4.0 domain with Exchange Server 5.5 to a completely new Windows Server 2003 Active Directory domain with Exchange Enterprise Server 2003.

However, they had an Exchange Server 5.5 server that kept shutting down the Exchange Information Store service on a fairly regular basis. Soon enough this problem would be a thing of the past due to the unlimited database size in Exchange Enterprise Server 2003 and the very large capacity SAN the company already had in place. But what could they do in the meantime to keep an eye on that pesky Exchange 5.5 private store?

Each server shutdown resulted in approximately three hours of downtime between database copies and defragmentations using the eseutil utility. (For safety's sake the company's procedures dictated that a copy of the priv.edb file be made before eseutil was run and then again afterwards. The copy after running eseutil was so that a subsequent failure before the next backup--run daily at 3 a.m.--would not require the process to be repeated.)

While it's certainly not a large amount of work to manually monitor the size of the priv.edb file (so that offline defragmentation could be accomplished during non- production hours), anything that can make an already busy administrator's day a little easier is certainly welcome.

Enter VBScript. The simple script below checks the size of the priv.edb and lets you know how large it is--and thus how much time you have before you need to act.

' CHK_PRIV.vbs
' WSH script to check file size of Exchange Private Store
' Will Schmied
' Version 1.0.0, September 16, 2004

' Define the variables
Dim objFSO, objFile, strFileSpec

' Specify the file to check
' Be sure to provide the full file path, either absolute or UNC
' Example: \ \ECHSVR \G$ \EXCHSRVR \MDBDATA \PRIV.EDB
' Example: G: \EXCHSRVR \MDBDATA \PRIV.EDB
' Ensure the path is placed between the quotes
strFileSpec = "PATH TO PRIV.EDB FILE"

' VBS work area
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strFileSpec)

' Produce a useful output
WScript.Echo "The Exchange Private Store is " & objFile.Size/1073741824
& " GB" & vbNewLine & _
" (which is " & objFile.Size/1048576 & " MB)"


Will Schmied, BSET, MCSE, MCSA, is a messaging engineer for a Fortune 500 manufacturing company. He has written for Microsoft, Pearson, Sybex, Syngress, TechTarget and several other organizations. He has also worked with Microsoft in the MCSE exam-development process.


Do you have a useful Exchange tip to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchExchange.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Exchange Server Administration Tips
Benefits of backing up Exchange Server with Microsoft's DPM 2007
Exchange Server 2007 replication and database transaction basics
Microsoft Exchange Server 2003 database recovery methods
Automate complex Exchange 2007 Management Shell tasks via scripting
Considerations for virtualizing Exchange 2007 mailbox servers
Extracting Exchange ActiveSync data from IIS log files
How to virtualize Exchange Server 2003
Microsoft Exchange Server mailbox recovery using database portability
Plan an Exchange 2007 standby continuous replication (SCR) deployment
Set up messaging records management (MRM) in Exchange Server 2007

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Email Server Solutions: Exchange 2007, Exchange 2003, Exchange 2000, SharePoint
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts