Av rating:
Total votes: 2
Total comments: 2


Michael Francis
Top Tips for Exchange Admins
22 August 2008

Top Tips for Exchange Admins

Our top tips competition this month have been dominated by one man, an admin of rare enthusiasm.

Ben Lye of The MathWorks has sent us 3 tips this week, and these are as follows.


In the spirit of the Olympics….the Gold goes to….

Disabling PST files – straightforward I know, but this is something every admin should do. The effort this takes, vs. the effort it could save, means we have a clear victor. Ben writes….

“Microsoft Outlook supports a couple of options for restricting PST files.  The first is a registry change called PSTDisableGrow prevents new data being added to existing PST  files.   The second is a registry change called DisablePST which prevents users creating or opening PST files altogether.  The settings can be applied individually or together to phase out the use of PST files, and they can both be applied through group policy.

 PSTDisableGrow doesn’t have a great deal of documentation, but DisablePST is pretty well documented here: http://support.microsoft.com/kb/896515.”

 Silver goes to a hardworking runner-up, striving for automation and convenience…..

 Smallest database script – Put in the effort, quite useful, but doesn’t quite have the sheer vital, everyone-must-do-this-now urgency of the first place.

 “It’s based on one we use as part of our mailbox provisioning process, and it returns the smallest database on a specified server.  By default it sums the sizes of all the mailboxes in each database, but it can also look at the size of the EDB file instead.  (Summing the mailbox size will avoid counting whitespace in the EDB file.)  It would be pretty easy to modify to look at specific storage groups, or use other search criteria (we look for databases which are named according to physical office locations, and pick the smallest database for that office).

 The script takes two parameters – the server name and the optional flag to look at EDB file sizes instead of mailbox sizes.  If the server name isn’t specified you will be prompted for it.

 To get the smallest database on a server name SERVER01 using mailbox sizes:

Get-SmallestDatabase.ps1 -server SERVER01

To get the smallest database using the EDB file size:

Get-SmallestDatabase.ps1 -server SERVER01 -edb

The script returns the database object as the output, but again that could easily be changed to suit a particular need.”

# Script to return the smallest database on a specified server

# Written by Ben Lye - 20th August 2008

 

# By default the smallest database is determined by summing the size of all the mailboxes in each database.

# Optionally the -edb flag can be specified to make the script look at the EDB file size instead.

# If no server name is specified on the command line one will be prompted for

 

# Usage:

# Get-SmallestDatabase.ps1 [-Server <Server name>] [-edb]

 

# Get the command line parameters

Param ([string]$server,[switch]$EDB)

 

# Load the Exchange 2007 snap-in if they are not already loaded

Add-PSSnapIn -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue

 

# Check that the Exchange 2007 snap-in loaded

$snapin = Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue

If (-not $snapin) {

       Write-Host "Error: Exchange 2007 snap-in not found" -ForegroundColor "Red"

       Write-Host

       break

}

 

# Prompt for a server name if one wasn't passed in

if (-not $server) {

       $server = Read-Host "Server name"

}

 

# Find any databases on the specified server

$databases = Get-MailboxDatabase -Server "$server" -ErrorAction SilentlyContinue

 

# Error if there are no databases found

If (-not $databases) {

       Write-Host "Error: No databases found for server $server" -ForegroundColor "Red"

       Write-Host

       $break

}

 

If ($databases) {

       # Prepare some variables for storing the name and size of the smallest database

       $smallestdbsize = $null

       $smallestdb = $null

 

       # Loop through each of the databases

       Foreach ($database in $databases) {

 

              If ($EDB) {

                     # Get the size of the .edb file

                     $dbsize = (get-childitem ("\\" + $database.Server + "\" + $database.EDBFilePath.PathName -replace(":","$")) | select-object name,length).length

              } Else {

                     # Get the database size in bytes by summing the size of all mailboxes in the database

                     $dbsize = (Get-MailboxStatistics -Database $database.Identity  | Measure-Object -Property TotalItemSize -Sum).Sum

              }

 

              # Compare the sizes to find the smallest DB

              if (($dbsize -lt $smallestdbsize) -or ($smallestdbsize -eq $null)) {

                     $smallestdbsize = $dbsize

                     $smallestdb = $database   

              }

       }

 

       # Return the smallest database

       $smallestdb

}

And finally, the Bronze….

 Change the mailbox information cache refresh  Neat, but I guess most of you that are in a hurry to apply mailbox information already caught onto this. Third place.

“By default the Exchange Information Store service caches information about mailboxes for two hours, meaning that any changes to mailbox quotas can take up to two hours to take effect.  You can change the cache refresh interval to a recommended value of 20 minutes which means that you only have to wait a maximum of 20 minutes for mailbox quota changes to take effect.

This TechNet article describes the problem and the registry changes required to reduce the cache refresh interval:
http://technet.microsoft.com/en-us/library/bb684892.aspx


Ben will win the grand prize of a $50 Amazon voucher for his efforts (that’s about 1/6th the value of a real Olympic Gold, fact fans).

If you want a chance of winning a $50 Amazon voucher (with last month’s entry rates, your odds are pretty good), or you simply feel the need to share knowledge with your fellow humans, then send your Exchange top tips for next month’s competition to michael.francis@simple-talk.com 



This article has been viewed 1638 times.
Michael Francis

Author profile: Michael Francis

Michael Francis is the Simple Talk Exchange Editor. Michael has 15 years’ experience in editing, writing, and marketing covering a broad spectrum of topics and publications. He has edited technical patents and chemistry journals, written for publications ranging from New Scientist to Pest Control News, and marketed scientific modeling software, machine-to-machine connectivity, and SQL Server and Exchange Server tools. In his spare time Michael enjoys cricket, natural history, camping, and getting beaten at football by his children.

Search for other articles by Michael Francis

Rate this article:   Avg rating: from a total of 2 votes.


Poor

OK

Good

Great

Must read
 
Have Your Say
Do you have an opinion on this article? Then add your comment below:


Subject: The Gold
Posted by: Kyle (not signed in)
Posted on: Thursday, August 28, 2008 at 10:35 AM
Message: Sorry I'm a newbie in the world of Exchange. Can you explain why I would want to disable PST access for clients? All my users run Outlook 2007 so I suppose its not of any concern to me, but I'm still curious.

Subject: Re: Kyle
Posted by: mikef (view profile)
Posted on: Friday, September 12, 2008 at 10:22 AM
Message: Hi

A PST environment easily becomes a nightmare for SysAdmins and end-users alike - hence the phrase 'PST hell'.

PST files are not routinely backed up, not searchable and easily lost - what happens when a hard disk dies or a computer is lost/stolen? Far better getting an Archiver...

Enter your comment here:

  Name: 
  Subject: 
  Message: 
 
 

Managing Exchange 2007 Mailbox Quotas with Windows PowerShell
 The use of PowerShell with Exchange Server 2007 can do a great deal to ease the task of managing... Read more...

The Road to Beta - Exchange Server Archiver speaks!
 Richard, Robert and Marine at Red Gate Software talk about designing, developing and testing Exchange... Read more...

Exchange Server Archiver, Las Vegas, Lemons and Whales
 It’s the fall and the leaves are falling all around us. And so are the barriers to Exchange Archiving. Read more...

Reporting on Mobile Device Activity Using Exchange 2007 ActiveSync Logs
 In this new column giving practical advice on all things Sys Admin related, Ben Lye takes on the often... Read more...

Asking for help – come and talk to us!
 “When you buy something from a self-assembly furniture shop, do you read the instructions?” This was... Read more...

Using Exchange 2007 for Resource Booking
 The process of booking various resources to go with a meeting room just got a whole lot easier with... Read more...

Free Exchange Server eBook
 Simple-Talk has teamed up with Sybex to give you a free copy of "Best of Exchange Server 2007" Read more...

High Availability in Exchange 2007
 Neil Hobson writes about the ways that MS Exchange 2007 can ensure that your organisations messaging... Read more...

Message Hygiene in Exchange Server 2007
 Around four out of every five email messages are spam. Now that the nuisance threatens to engulf what... Read more...

Controlling Email Messages using Exchange's Transport Rules
 Some tasks that should have been easy in previous versions of Exchange just weren't. Now, with... Read more...

Over 150,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.

Join Simple Talk