Here’s a PowerShell one liner that you’d probably never want to run in production.
Get-Mailbox | Remove-Mailbox
Oi!
Here’s a PowerShell one liner that you’d probably never want to run in production.
Get-Mailbox | Remove-Mailbox
Oi!
Exchange 2007 introduced a helpful new feature caleld transport rules. I’ve given presentations on some of the cool things you (or the Duke boys) can do with Exchange transport rules at conferences… I’ll see about transitioning some of that information to this site in the future.
One of the ‘gotchas’ related to Exchange 2007 transport rules is the ammount of time required for replication. It doesn’t really get too much attention when Microsoft (or others) are discussing some of the theoretical uses for transport rules. Let’s say that you needed to implement a transport rule to add a link to the latest company press release on all outbound mail. The CMO calls at 8AM and wants the change to be in place by noon. Ignoring the possible change control issues, can you modify your outbound signatures in time?
The answer? It depends.
The first concern is that transport rules in Exchange 2007 are stored in Active Directory. As a result propagation of changes is predicated on AD replication for your topology. In a small, single server Exchange environment odds are AD replication won’t be a factor. but in a large or multi-national organization AD replication could easily take a day (or 2 if they are using AD lag sites).
Microsoft mentions this in a TechNet article on Transport Rule application:
Important: Replication of transport rules across an organization is dependant on Active Directory replication. Replication time between Active Directory domain controllers varies depending on the number of sites in the organization, slow links, and other factors outside the control of Exchange. When you configure transport rules in your organization, make sure that you consider replication delays.
The other area of potential concern is the Hub Transport server cache. Rather than quering each rule against AD every time it is applied, the Hub Transport server caches the results from AD for 4 hours before checking again for changes to the rule. So a request at 8AM could take up to 4 hours to take effect even in a single server environment. (Although restarting the Microsoft Exchange Transport Service will force an immediate requery and assuming the AD replication has taken effect the transport rule changes will take effect).
Important: Each Hub Transport server maintains a recipient cache that is used to look up recipient and distribution list information. The recipient cache reduces the number of requests that each Hub Transport server must make to an Active Directory domain controller. The recipient cache updates every four hours. You can't modify the recipient cache update interval. Therefore, changes to transport rule recipients, such as the addition or removal of distribution list members, may not be applied to transport rules until the recipient cache is updated. To force an immediate update of the recipient cache, you must stop and start the Microsoft Exchange Transport service. You must do this for each Hub Transport server where you want to forcibly update the recipient cache.
So, total replication time for a transport rule change could be max AD replication interval for your organization plus 4 hours.
I’m sure there is a perfectly reasonable explanation why telnet is not installed by default on Vista. Unfortunately every email administrator needs it for troubleshooting. Below are the steps to install telnet on a Vista machine.
Or open a command prompt with admin level privledges and type pkgmgr /iu:TelnetClient
With the release of Exchange 2007 SP 1 Microsoft has added support for Windows 2008. Why would you want to deploy Exchange 2007 on Windows 2008? Probably the biggest reason would be support for IPv6. Installation on Windows 2008 is an “interesting” change. Much more of the work is done from within PowerShell. The advantage to this is that it is easily scriptable (or a simple copy/paste). Having installed various versions of Exchange several hundred times (not an exaggeration unfortunately) I know how easy it is to forget to install a prerequisite component. I’ve probably forgotten to install NNTP 50 times (not quite sure what that says about me). Below are the steps to set-up the prerequisites for a CAS server.
The first step is to install the Remote Server Administration Tools:
ServerManagerCmd -i RSAT-ADDS
Following that you’ll need to install PowerShell:
ServerManagerCmd -i PowerShell
And then you’ll need to configure IIS prerequisites (order matters here):
ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Digest-Auth
ServerManagerCmd -i Web-Windows-Auth
ServerManagerCmd -i Web-Dyn-Compression
For additional information on installing Exchange 2008 check out the TechNet entry here.
Here’s a list of common ports used for e-mail.
RPC/HTTP uses port 80 and RPC/HTTPS uses port 443 for all you Outlook/Exchange users. I intentionally left off the port for Secure SMTP as TLS over the standard port (25) is the preferred implementation. If you really need it, exercise some Google-fu.
There are occasions where an Exchange server’s queues may fill. If those messages are junk, NDRs, spam or relayed messages it may be desirable to delete those messages en mass. Using the ESM UI can be painful at best. If there are thousands of destination domains there is no easy way in the UI to delete these messages. Selecting each queue in turn can take hours to complete. Enter aqadmcli.exe a utility available for download from Microsoft. Using aqadmcli.exe thousands of queues filled with NDRs can be cleared with a single command:
aqadmcli.exe “delmsg flags=SENDER,sender=postmaster@example.com“ Read the rest of this entry »
Microsoft has released update rollup 5 for Exchange 2007 SP1.
One of the fixes was for an issue that impacted a number of my customers:
951273 (http://support.microsoft.com/kb/951273/ ) The received date and the received time of IMAP messages are changed to the time of migration after you migrate mailboxes to an Exchange 2007 Service Pack 1-based server.
Download: http://www.microsoft.com/downloads/details.aspx?familyid=652ed33a-11a1-459c-8ffe-90b9cbfe7903&displaylang=en&tm
Fixes: http://support.microsoft.com/?kbid=953467
Lee Holmes has a fun Powershell script you can use to insert a calendar into your out of office reply to visually represent when you will be out of the office and when you will return.
I will be out of the office January 1st through the 5th.
January 2009 Sun Mon Tue Wed Thu Fri Sat --- --- --- --- --- --- --- 28 29 30 31 [ 1] [ 2] [ 3] [ 4] * 5* 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
This doesn’t require Exchange 2007, you simply need to have Powershell installed to run the script. If you haven’t already downloaded Powershell to play with it, you can find it here.
Update: I found the Outlook Team method for achieving the same thing. Their method doesn’t use Powershell, so it’s not nearly as cool.
Some more Friday fun.
If you’ve been working with Exchange for a long time as I have, you’ve come to appreciate some of the esoteric quirks of the product. Knowing how to force a recategorization of messages in Exchange 2003 or how to create domain mappings in the Exchange 5.5 IMC are just a couple of examples.
By far and away my favorite bit of Exchange history is the story surrounding the squeaky lobster. Every time I needed a customer to set this registry key or provided it as a troubleshooting step on a mailing list or newsgroup I laughed at the absurdity of it. So when a friend of mine mentioned that Microsoft was auctioning off the squeaky lobster for charity, I decided I must own it. I contacted someone at Microsoft who agreed to act as my proxy in the bidding process and successfully fended off all other comers to secure a piece of Exchange history.
Behold! The squeaky lobster.

Why yes, I am a nerd. But I’m a nerd with a lobster.
My friend Daniel has an article on customizing the command prompt in Windows Vista and Windows Server 2008 in order to easily identify what machine you are on. I thought it was a great idea, but I didn’t want to use the registry editor to do it. So I wrote a Powershell script to do the same thing.
It’s a pretty simple script and it will only create and populate the key if it doesn’t already exist.
$location = ‘HKLM:SYSTEMCurrentControlSetControlSession ManagerEnvironmentPrompt’
$location2 = ‘HKLM:SYSTEMCurrentControlSetControlSession ManagerEnvironment’
if (Test-Path $location ) {”Key exists, no changes were made”
} else {New-ItemProperty -Path $location2 -Name Prompt -Value {”$_Server:%computername%$_Username:%username%$_Date:$D$_Time:$T$_$p$g”} -PropertyType ExpandString}
This is a ‘lab ready’ script. Please test before using in production.