Comments : 0

Mailbox Report Script for Exchange Server

Category : Exchange Server

One of the tasks that every Exchange Server administrator faces as part of their daily or weekly maintenance is getting the mailbox size report of the Exchange Server. The PowerShell commands do help in getting the relevant data, but doing this rudementary task manually everytime is painstaking. Here is a small script which can used to generate the mailbox statistics report and then automatically email the same as an attachment. To automate this further, one can create a Scheduled Task in Task Manager so that it runs at the specified interval.

###Exchange Mailbox Statistics Script
###Modify Variable Data
$FromAddress = "noreply@domain.com"
$ToAddress = "administrator@domain.com"
$MessageSubject = "Exchange Mailbox Report"
$MessageBody = "Mailbox Statistics of Exchange Server is attached with this email."
$SendingServer = "exchangeserver.yourdomain.com"
####DO NOT EDIT BELOW THIS LINE
###Get Stats and Prepare Text File
Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}}, ItemCount, StorageLimitStatus > mailboxes.txt
###Create Email and Attach Report
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress,
$MessageSubject, $MessageBody
$Attachment = New-Object Net.Mail.Attachment("mailboxes.txt")
$SMTPMessage.Attachments.Add($Attachment)
###Send Email
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
$SMTPClient.Send($SMTPMessage)

Hope the above script helps and saves the administration time.

Comments : 0

TMG Managed Control Service, Exchange Edge and FPE

Category : Exchange Server, ISA Server and Forefront

Recently I encountered TMG Managed Control Service crashing at a client site where they have been using TMG as a back-end firewall. The same server was also being used as an Exchange 2007 Edge server also running Forefront Protection for Exchange 2010. All server roles were patched with the latest updates and rollups. The connectivity between the Edge and the Hub was implemented successfully and also verified using Test-EdgeSync. TMG also showed Edge and Hub connectivity. Everything looked healthy but the IT administrator was receiving email alerts with the following:

“Email Policy could not be applied. Value does not fall within the expected range.”

Went to the services MMC and tried to start the TMG Managed Control Service manually. The service failed to start. Upon checking the event logs, I found that the Application Log showed:

 - Event ID 31309: E-mail policy configuration settings cannot be applied.
- Event ID 31308: The Forefront TMG Managed Control service failed to initialize. Error information: The type initializer for ‘Microsoft.Isa.Smtp.ExchangeRunspace’ threw an exception.
- Event ID 31307: The Forefront TMG Managed Control service was stopped gracefully.

and the System Log showed Event ID 7023: The Microsoft Forefront TMG Managed Control service terminated with the following error: %%-2146233036

The next step was to check the Edge and Hub communication and as expected it should that the sync was not working. TMG console showed everything configured and all Anti-Spam rules enabled. I had no choice but to pick up the phone and shake someone up in Microsoft technical team for an answer. Sadly, no clue from there too, but one thing that came up in the discussion was to clear all Anti-Spam settings and then give this a reboot. Long process, but to cut things short, here is the solution that worked.

For those facing this issue, open up Exchange Shell on the Edge server and run:

Get-IpBlockListEntry

This should come up with a list of entries. The next step is to remove these. Run the following command:

Get-IpBlockListEntry | RemoveIpBlockListEntry

To clear all entries, answer with an “A”. Started the service this time and the TMG Managed Control Service started successfully.

Though running the command of Get-IpBlockListEntry after 10-15 minutes showed that the list was building up once again and after 30 minutes the TMG managed Control Service crashed once again.

The only workaround that I could implement to fix this permanently was to disable the Sender Reputation Service in TMG. It has been more than a week now and the TMG Managed Control Service has not crashed once.

Comments : 2

It’s a bird…It’s a plane…It’s Exchange 2010!

Category : Exchange Server

 

 

 

Microsoft officially released a public Beta of Exchange 2010 which was formerly code named ‘Exchange 14”. I was already blinded by the features that Exchange 2009 provided – Unified Messaging being the best of the many and now we have Exchange 2010 in the pipeline. There are so many improvements in this version that I can’t decide which ones to highlight and talk about first. The product claims to achieve high levels of reliability with greater flexibility, enhanced user experiences and increased protection for business communications.

OWA (Outlook Web Access) has been scaled out to support Internet Explorer – 7 and 8, Firefox 3 and Safari 3. Users will no longer be restricted to using Internet Explorer. OWA has been further improved to provide a web user with all the functionality of Outlook desktop client. Also, a new feature of conversation view has been added greatly reducing mailbox clutter.

Voice Mail Preview is another feature that deserves applause. OWA and Outlook 2010 support voice mail previews. Exchange 2010 automatically generates text based preview of a voice mail message received. Not sure how accurate this is going to be but the concept itself is worth it.

Users will be able to create and moderate their own Distribution Groups and can also decide who they want their Calendar and Contacts shared with.

Ever got bounce backs after sending emails with large attachments or accidently sent a personal email to everyone in your company? Now you need not worry about that. MailTips is a new feature added up which prompts you before you send a message.

Message Tracking and Delivery Reports has been improvised in Exchange 2010 – works well inside the Exchange Organization and federated servers.

No more Administrator privileges required to scan or search other mailboxes in the organization to meet compliance. Authorized users can perform MultiMailbox Searches without the use of administrative rights.

Self service via Exchange Control Panel (ECP) is now made available to the end-user. This means that a user can now update their personal details in their account which earlier required a help desk call or ticket.

Database portability and multiple options for high availability were already made available in Exchange 2009. These have been further improved in Exchange 2010 and also open possibilities of reducing the operations costs. Database Availability Groups now gives redundant mail stores with continuous replication. Database-level Failover gives automatic recovery and the I/O optimizations make Exchange 2010 better suited for SATA drives.

These are just some of the powerful features that have been released in the Beta. We may be having a few more added to these in the final specimen. Overall the new version of Exchange looks very promising and exciting.